python中raw input的用法,Python基本语法-新手教程-函数用法:input()和raw_input(),基础,菜鸟,rawinput...

1.input()和raw_input()用法

(1).input()

1)用法解释

def input(*args, **kwargs): # real signature unknown

“”"

Read a string from standard input. The trailing newline is stripped.

The prompt string, if given, is printed to standard output without a

trailing newline before reading input.

If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.

On *nix systems, readline is used if available.

“”"

pass

2)使用实例

eg:有如下实例

value=input()

print(value)

输出结果为:

1

1

​(2)raw_input()

Python3将raw_input和input进行整合成了input…去除了raw_input()函数…

其接受任意输入, 将所有输入默认为字符串处理,并返回字符串类型

你可能感兴趣的:(python中raw,input的用法)