day01

输入输出:
print()函数也可以接受多个字符串,用逗号“,”隔开,就可以连成一串输出:
>>> print('The quick brown fox', 'jumps over', 'the lazy dog')

注意,逗号的位置会打印一个空格

input()可以让你显示一个字符串来提示用户,于是我们把代码改成:
name = input('please enter your name: ')
print('hello,', name)

注意,input()函数返回的数据类型是str。
因为input()返回的数据类型是str,str不能直接和整数比较,必须先把str转换成整数。Python提供了int()函数来完成这件事情:
s = input('birth: ')
birth = int(s)
if birth < 2000:
  print('00前')
else:
  print('00后')

Python允许用r''表示''内部的字符串默认不转义,类似C#中的@

>>> print(r'''line1
... line2
... line3''')
line1
line2
line3

原文地址:https://www.cnblogs.com/ll-10/p/9676447.html