Skip to content

Commit 4e6b9b6

Browse files
第二次学习
1 parent 4aaa0c4 commit 4e6b9b6

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

day-00/hello-world.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
#!/usr/bin/env python3
2-
print('hello, world!')
2+
print('hello, world!')
3+
print('I am', 'a good', 'boy')
4+
# 这里是注释部分
5+
name = input('please enter your name:')
6+
print('Hello,', name)

day-01/data-typpes-and-variables.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,40 @@
4646
print(p)
4747
# 无限大
4848
r = inf
49-
print(r)
49+
print(r)
50+
51+
# 第二次练习
52+
# 字符串
53+
print('====== 第二次练习 ======')
54+
print('a')
55+
print('"a"')
56+
print('\'a"')
57+
print('\n')
58+
print(r'\n')
59+
print('''the first line
60+
the second line\n
61+
the third line''')
62+
print(r'''the first line
63+
the second line\n
64+
the third line''')
65+
# 布尔值 注意大小写
66+
print(0 > 1)
67+
print(2 > 1)
68+
print(True, False)
69+
# 布尔运算
70+
print(0 and 1)
71+
print(1 and 1)
72+
print(0 or 1)
73+
print(0 or 0)
74+
print(not 0)
75+
print(not 1)
76+
# 空值
77+
print(None)
78+
# 除法运算
79+
print(10 / 3)
80+
print(9 / 3)
81+
# 地板除
82+
print(10 // 3)
83+
print(9 // 3)
84+
print(10 % 3)
85+
print(9 % 3)

0 commit comments

Comments
 (0)