How to read inputs?


Read space separated values from input

Read strs.

http://stackoverflow.com/a/43432292/230100

import sys

if __name__ == '__main__':
    key = "football"
    for line in sys.stdin:
        sport, number = line.split()
        if sport == key:
            print "{}, {}".format(sport, number)
            break
    else:
        print "{} not found".format(key)

Read int

import sys

n = int(raw_input().strip())

Read integers into array

import sys

arr = map(int, raw_input().strip().split(' '))

results matching ""

    No results matching ""