-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path037-User-Input-Program.py
More file actions
51 lines (42 loc) · 2.08 KB
/
Copy path037-User-Input-Program.py
File metadata and controls
51 lines (42 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
===============================================================================
User Input Program
===============================================================================
Program Description:
--------------------
This program demonstrates how to accept input from the user using the
input() function in Python.
The input() function waits for the user to enter a value from the
keyboard. By default, the entered value is stored as a string.
Author : Shaik Mahaboob Basha
Repository : 13-Python
File Name : 37-User-Input-Program.py
===============================================================================
"""
# -----------------------------------------------------------------------------
# Displaying a message to the user.
# -----------------------------------------------------------------------------
print("Python User Input Program")
# Output: Python User Input Program
# -----------------------------------------------------------------------------
# Accepting the user's name using the input() function.
# -----------------------------------------------------------------------------
name = input("Enter Your Name: ")
# The entered value is stored as a string.
# -----------------------------------------------------------------------------
# Displaying the entered name.
# -----------------------------------------------------------------------------
print("Your Name is :", name)
# Output:
# Enter Your Name: Mahaboob
# Your Name is : Mahaboob
# -----------------------------------------------------------------------------
# Displaying the data type of the entered value.
# -----------------------------------------------------------------------------
print("Data Type :", type(name))
# Output: Data Type : <class 'str'>
# -----------------------------------------------------------------------------
# Displaying an important note.
# -----------------------------------------------------------------------------
print("Note: The input() function always returns a string by default.")
# Output: Note: The input() function always returns a string by default.