+ 1
User input
Can anyone teach me how do i make "user input" in this app
5 Answers
+ 1
You can use the following formats
For integers
variable_name = int(input())
For floats
variable_name = float(input())
For strings
variable_name = input()
You can use the eval function to handle all case as such
variable_name = eval(input())
+ 2
Thanks for your help
+ 1
Use
Variable_ name = input()
0
Put in this format
Variable name = input()
0
I like using prompt toolkit more, although it also returns string like input() but it looks prettier and more powerful
from prompt_toolkit import PromptSession
user_input = PromptSession().prompt('>>> ')
# Same as input() next