python学习(一)
? ? ?应该是第多次学习python了,都是学习到一半,就停止了,这次要坚持下去,fighting!!!
函数学习:
? ? ? ??raw_input() ??从标准输入读取一个字符串并自动删除尾的换行符,并将读取到的数据赋值给指定变量
例子:
>>> num = raw_input('Enter login name')
Enter login name
>>> num = raw_input('Now enter a number:')
Now enter a number:1024
>>> print 'Doubling your number:%d' % (int(num) *2)
?
Doubling your number:2048
? ? ? ? help() ?的参数能得到相应的帮助信息
例子:
Help on built-in function raw_input in module __builtin__:
?
raw_input(...)
? ? raw_input([prompt]) -> string
? ??
? ? Read a string from standard input. ?The trailing newline is stripped.
? ? If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
? ? On Unix, GNU readline is used if enabled. ?The prompt string, if given,
? ? is printed without a trailing newline before reading.
?
?