- 数字类型:
int
、complex
、float
布尔类型:True
、False
字符串类型:格式化、切片
show you the code
while True:
s = input('Please input a str within length of 20: ')
if len(s) > 20:
print('The str you have inputted exceed the length limit!', end='')
else:
print("Length: %d, reversed: %s" % (len(s), s[::-1]))
'3'+'4'
的结果是'34'