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 …