0
How to input in python
4 Réponses
+ 3
# String
x = input()
# Integer
x = int(input())
# Float
x = float(input())
Note that the user's input is assigned in its variable, here the inputs are assigned in variable "x"
For more, continue your course as it will be discussed in your next module. Happy Coding!
+ 2
Name_of_variable = type(input("What do you want to take "))
Types-->
str() <--Converts evrything in strings
int() <--Convert the automatic sting at --the input to an number.
abs() <--Absolute value
Etc...
0
print ('....');
0
Or
n=input('...');