Skip to content

Commit 7695c92

Browse files
committed
first commit
0 parents  commit 7695c92

File tree

236 files changed

+64350
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+64350
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src
2+
*~
636 Bytes
Binary file not shown.
304 Bytes
Binary file not shown.

Chapter02/animals.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
animals = ['tiger', 'lion', 'elephant']
2+
3+
for animal in animals:
4+
print('The ' + animal + ' would make a great pet.')
5+
6+
print("Any of these animals would make a great pet!\n")
7+
8+
9+
10+

Chapter02/animals.py~

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
animals = ['tiger', 'lion', 'elephant']
2+
3+
for animal in animals:
4+
print(animal)
5+
6+

Chapter02/board.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def board(news, name_list):
2+
print("\n")
3+
print("\t\t\t\t---News---")
4+
print("\n")
5+
print(news)
6+
print("\n")
7+
8+
print("<member>")
9+
for name in name_list:
10+
print(name)
11+
12+
print("\n")
13+
14+
def invite(name_list):
15+
print("\n")
16+
for name in name_list:
17+
print("Hello, " + name.title() + "!")
18+
19+
print("Why don't we have a lunch on May 5 "\
20+
+ "at the Soka station?")
21+
print("\n")
22+
23+
24+

Chapter02/board.py~

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def board(news, name_list):
2+
print("\t\t\t\t---News---")
3+
print("\n")
4+
print(news)
5+
print("\n")
6+
7+
print("member :")
8+
for name in name_list:
9+
print(name + " ")
10+
11+
12+

Chapter02/car.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cars = ['bmw', 'audi', 'toyota', 'subaru']
2+
cars.sort()
3+
print(cars)
4+
5+
cars.sort(reverse=True)
6+
print(cars)
7+
8+
cars = ['bmw', 'audi', 'toyota', 'subaru']
9+
10+
print("Here is the original list:")
11+
print(cars)
12+
13+
print("\nHere is the sorted list:")
14+
print(sorted(cars))
15+
16+
print("\nHere is the original list again:")
17+
print(cars)
18+
19+
cars = ['bmw', 'audi', 'toyota', 'subaru']
20+
print(cars)
21+
22+
cars.reverse()
23+
print(cars)
24+
print(len(cars))
25+
26+
motorcycles = ['honda', 'yamaha', 'suzuki']
27+
print(motorcycles[-1])
28+
29+
motorcycles = []
30+
print(motorcycles[-1])
31+
32+

Chapter02/car.py~

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cars = ['bmw', 'audi', 'toyota', 'subaru']
2+
cars.sort()
3+
print(cars)
4+
5+
cars.sort(reverse=True)
6+
print(cars)
7+
8+
cars = ['bmw', 'audi', 'toyota', 'subaru']
9+
10+
print("Here is the original list:")
11+
print(cars)
12+
13+
print("\nHere is the sorted list:")
14+
print(sorted(cars))
15+
16+
print("\nHere is the original list again:")
17+
print(cars)
18+
19+
cars = ['bmw', 'audi', 'toyota', 'subaru']
20+
print(cars)
21+
22+
cars.reverse()
23+
print(cars)
24+
print(len(cars))
25+

Chapter02/commute.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
favorite_tank = ['T-90', 'T-72', 'T-64', 'T-62', 'M1A1', 'M1A2', 'AMX-70']
2+
3+
for tank in favorite_tank:
4+
print("I would like own " + tank)
5+

0 commit comments

Comments
 (0)