Skip to content

Commit e1148aa

Browse files
committed
2018年 03月 16日 星期五 23:59:51 CST学习python第一天
1 parent 34f2e47 commit e1148aa

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

python/pratice/conditional.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#read in age
2+
age = int(input("what's your age?"))
3+
if age >= 18:
4+
print("Access allowed")
5+
elif age<18 and age>0:
6+
print("Access not allowed")
7+
else:
8+
print("Invalid age")

python/pratice/dictionary.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# create a dictionary
2+
person = {
3+
"name":"Amos",
4+
"age":23,
5+
"hobbies":["Swimming","Coding"]
6+
}
7+
for key in person:
8+
print(person[key])

python/pratice/list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#create a list
2+
my_list = [1,2,3,"python",67,[5,4]]
3+
for item in my_list:
4+
print item

0 commit comments

Comments
 (0)