Skip to content

Instantly share code, notes, and snippets.

@darkmatter18
Last active December 14, 2020 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkmatter18/32fa32e87c0b0f7804275df2525ff442 to your computer and use it in GitHub Desktop.
Save darkmatter18/32fa32e87c0b0f7804275df2525ff442 to your computer and use it in GitHub Desktop.
# Take Multiple integer Input in single line
# and Store the inputs in a list(Python Array).
numbers = list(map(int, input("Enter space separated inputs").split()))
#print inputs
print(numbers)
# Take Multiple integer Input in single line
# and Store the inputs in a list(Python Array).
# Take the input
text = input("Enter your space separated numbers")
# Split the whole string into a list of strings
text_split = text.split()
print(text_split)
# Map each value to int and store into a list
numbers = list(map(int, text_split))
#print inputs
print(numbers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment