Following python program will read and print name, address and mobile number of the user.
Concept to learn
input ( ) : Python input() function can be used to read user inputs. No need to specify variable data type as Python automatically identifies whether entered data is a string or a number.
Source code
# Python program to read and print your name and address using the input() function. name = input("Enter your name: ") print(name) address = input("Enter your address:") print (address) mobile = input("Enter your mobile number:") print(mobile)
Program output
Enter your name: K Patel
K Patel
Enter your address: Ahmedabad, Gujarat, India
Ahmedabad, Gujarat, India
Enter your mobile number: 9898989898
9898989898
Enter your name: K Patel
K Patel
Enter your address: Ahmedabad, Gujarat, India
Ahmedabad, Gujarat, India
Enter your mobile number: 9898989898
9898989898
* * * * *
No comments:
Post a Comment