To take multiple variables as input in a single line, we can use split() function as : totalCities, totalPath = raw_input().split() To take a integer variable as input, we can use int() function as : T = int(raw_input()) When we take a variable as input using raw_input() function, python stores it as …
Category Archive: Python
Jan 03
To store all the alphabets in a list in python
We can store all the alphabets in a list as follows : import string alpha = [i for i in string.ascii_lowercase] for i in alpha : print i, OUTPUT : $ python test.py a b c d e f g h i j k l m n o p q r s …