-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput and Output.py
More file actions
27 lines (26 loc) · 1.3 KB
/
input and Output.py
File metadata and controls
27 lines (26 loc) · 1.3 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
#-------------------------------------------------------
#1. Input and Output
#-------------------------------------------------------
# What is Input in python?
#---------------------------------------------
# An input in python programming is the process of getting data from the user or external source.
# It is a way of getting data from the user or external source and storing it in a variable.
# In python input is gotten using the input() function.
# Example:
# x = input("Enter your name: ")
# print(x) #This will print the name entered by the user
#---------------------------------------------
# What is Output in python?
#---------------------------------------------
# An output in python programming is the process of displaying data to the user or external source.
# It is a way of displaying data to the user or external source.
# In python output is gotten using the print() function.
# Example:
# print("Hello World!") #This is an output statement
#---------------------------------------------
#Example:
# Write a program that ask a user to enter in their username and age and then print the appropiate message.
x = input("Enter your name: ")
y = input("Enter your age: ")
print("Hello " + x + " you are " + y + " years old.")
#-------------------------------------------------------