Last active
December 14, 2020 10:00
-
-
Save darkmatter18/32fa32e87c0b0f7804275df2525ff442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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