Skip to content

Instantly share code, notes, and snippets.

@parthvshah
Last active June 6, 2020 09:31
Show Gist options
  • Save parthvshah/a09a222ebdff6e732755b90573100b26 to your computer and use it in GitHub Desktop.
Save parthvshah/a09a222ebdff6e732755b90573100b26 to your computer and use it in GitHub Desktop.
Input methods for Python
# For a string
# 'youremywholeworld'
a = input()
# For single integer input
# 9
a = int(input())
# For multiple (small) input
# 8 9
a, b = input().split()
a = int(a)
b = int(b)
# For an array
# 3 4 8 9
a = list(map(int, input().split()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment