Answers for "How to take multiple inputs in one line in python using list comprehension"

0

How to take multiple inputs in one line in python using list comprehension

# taking two input at a time
x, y = [int(x) for x in input("Enter two values: ").split()]
print("x: ", x)
print("y: ", y)

# taking three input at a time
x, y, z = [int(x) for x in input("Enter three values: ").split()]
print("x: ", x)
print("y: ", y)
print("z: ", z)
Posted by: Guest on February-22-2022

Code answers related to "How to take multiple inputs in one line in python using list comprehension"

Browse Popular Code Answers by Language