how to take input in python in single line code example
Example 1: how to take input for list in one line in python
# Reads two numbers from input and typecasts them to int using
# list comprehension
x, y = [int(x) for x in input().split()]
Example 2: multiple line input python
lines = []
while True:
line = input()
if line:
lines.append(line)
else:
break
text = '\n'.join(lines)