python中注意事项(更新)

1.print(a,b),print打印多个变量,默认中间会有个空格作为分隔符,默认以换行符结尾

Docstring:
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file:  a file-like object (stream); defaults to the current sys.stdout.
sep:   string inserted between values, default a space.
end:   string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.
Type:      builtin_function_or_method

2.range(1,10),左闭右开,生成的结果为1-9 

3.input()获得的结果是字符串,如果要和数字比较,记得类型转换

posted @ 2020-08-03 22:56  小飞的学习笔记  阅读(195)  评论(0编辑  收藏  举报