# Multiple Inputs From User
# Way :
# split() method
# List comprehension
#map() function
# split() method
a, b = input("Enter Two Number :: ").split()
print("First Number :: ", a)
print("Second Number :: ", b)
print()
'''
Output ::
Enter Two Number :: 1 2
First Number :: 1
Second Number :: 2
'''
a, b, c, d = input("Enter Four Number :: ").split()
print("First Number :: ", a)
print("Second Number :: ", b)
print("Third Number :: ", c)
print("Four Number :: ", d)
print()
'''
Output ::
Enter Four Number :: 1 2 3 4
First Number :: 1
Second Number :: 2
Third Number :: 3
Four Number :: 4
'''
# List Comprehension
# For This First Know What is Comprehension
a, b = [int(i) for i in input("Enter Two Number :: ").split()]
print("First Number :: ", a)
print("Second Number :: ", b)
print()
'''
Output ::
Enter Two Number :: 1 2
First Number :: 1
Second Number :: 2
'''
a, b, c = [int(i) for i in input("Enter Three Number :: ").split()]
print("First Number :: ", a)
print("Second Number :: ", b)
print("Third Number :: ", c)
print()
'''
Output ::
Enter Four Number :: 1 2 3 4
First Number :: 1
Second Number :: 2
Third Number :: 3
'''
# map() Function
# map(typecasting, input)
a, b, c = map(int, input("Enter Three Number :: ").split())
print("First Number :: ", a)
print("Second Number :: ", b)
print("Third Number :: ", c)
'''
Output ::
Enter Four Number :: 1 2 3 4
First Number :: 1
Second Number :: 2
Third Number :: 3
'''
Comments
Post a Comment