![]() ![]() I have listed my code and added text from terminal. I haven’t used this forum before and was kinda confused how to set up a good question post. This has the added benefit that when there are problems you can justĬameron Simpson thanks for the reply. Then you can run it from a command prompt like this: python3 my_script.py You’d be better off putting this code into a file on its own, eg ![]() Tedious and error prone, as you see above. Synta圎rror: invalid syntax print('The integer is positive') ![]() Synta圎rror: invalid syntax print('The integer is zero') ValueError: invalid literal for int() with base 10: ‘if num < 0:’ print('The integer is negative') If num < 0: print('The integer is negative')Įlif num = 0: print('The integer is zero') But i want to run the entire thing at once. I want to know why i can’t run the entire script without getting errors? If i run the input() function alone, enter a integer value, and run the rest of the script, the result is fine. Instead i get a list of different errors. When i try to run the entire script shown below the input() function doesn’t prompt. Problem with input() function in python 3.10.0 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |