合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
``` Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> help(input) SyntaxError: invalid character '(' (U+FF08) >>> help(input) Help on built-in function input in module builtins: input(prompt=None, /) 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. >>> input(:) SyntaxError: invalid syntax >>> input(':') '' >>> input() '' >>> a =input() jlkjkjj刘会计会计会计 >>> a 'jlkjkjj刘会计会计会计' >>> int(a) Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> int(a) ValueError: invalid literal for int() with base 10: 'jlkjkjj刘会计会计会计' >>> ValueError: invalid literal for int() with base 10: 'jlkjkjj刘会计会计会计' ``` ``` record = [] while True: info = [] userInput = input('Enter something: ') if userInput == "exit": break else: info=userInput.split(",") #info=userInput print(info) record+=[info] print(record) ``` ``` Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> raw_input() Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> raw_input() NameError: name 'raw_input' is not defined >>> input() 5 '5' >>> a = input() 9 >>> b = a**5 Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> b = a**5 TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int' >>> a '9' >>> b = int(a)**5 >>> b 59049 >>> a = input() 改好发的黑寡妇黑寡妇黑寡妇黑寡妇黑寡妇黑寡妇韩国 >>> for i in a SyntaxError: invalid syntax >>> for i in a: i '改' '好' '发' '的' '黑' '寡' '妇' '黑' '寡' '妇' '黑' '寡' '妇' '黑' '寡' '妇' '黑' '寡' '妇' '黑' '寡' '妇' '韩' '国' >>> ``` ``` for i in input(): print (i) ``` ``` print(int(eval(input()))) ```