How to get input from user in python
Python has an input function to accept inputs from the user. Python 2 uses raw_input(prompt) function whereas python 3 uses input(prompt).
prompt- a string, representing a default message before the input. This is not necessary.
a=input()
Input function will convert whatever you enter as input to string. We need to explicitly convert it into required data type using typecasting
Subscribe
Login
Please login to comment
0 Discussion