Skip to content

Commit f590294

Browse files
authored
create convert_test.py
1 parent ec6cfc3 commit f590294

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

exercise/convert_test.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# coding:utf-8
2+
name = '张三'
3+
age = 20
4+
print(type(name), type(age))
5+
print('我叫' + name + ',今年' + str(age) + '岁')
6+
7+
a = 10
8+
b = 198.8
9+
c = False
10+
print(type(a), type(b), type(c))
11+
print(str(a), str(b), str(c), type(str(a)), type(str(b)), type(str(c)))
12+
13+
s1 = '128'
14+
f1 = 98.7
15+
s2 = '76.77'
16+
ff = True
17+
s3 = 'hello'
18+
print(type(s1), type(f1), type(s2), type(ff), type(s3))
19+
print(int(s1), type(int(s1)))
20+
print(int(f1), type(int(f1)))
21+
# print(int(s2), type(int(s2)))
22+
print(int(ff), type(int(ff)))
23+
# print(int(s3), type(int(s3)))
24+
25+
s1 = '128.98'
26+
s2 = '76'
27+
ff = True
28+
s3 = 'hello'
29+
i = 98
30+
print(type(s1), type(s2), type(ff), type(s3), type(i))
31+
print(float(s1), type(float(s1)))
32+
print(float(s2), type(float(s2)))
33+
print(float(ff), type(float(ff)))
34+
# print(float(s3), type(float(s3)))
35+
print(float(i), type(float(i)))
36+
37+
# 当行注释
38+
39+
'''
40+
嘿嘿,
41+
我是多行注释哟
42+
'''

0 commit comments

Comments
 (0)