Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- def read_route_data():
- routesList = []
- with open("routes.txt", "rt") as in_file:
- routes = in_file.read()
- tempList = routes.split(',')
- i = 0
- while i < tempList.len:
- x = tempList[i]
- i = i + 1
- y = tempList[i]
- routesList.append({'route_number': x, 'happy_ratio': y})
- return routesList
- def sort_route_data(routesList):
- currentBest = 0
- for i in routesList.len:
- if (i == routesList.len):
- print ("fuk ya cunt")
- continue
- elif (i > routesList.len):
- print ("bigger")
- continue
- else:
- break
- while True:
- try:
- n = input ("How many routes can have an extra bus? ")
- n = int (n)
- except ValueError:
- print ("Invalid value. Please enter a non-negative integer")
- continue
- if n < 0:
- print("Invalid value. Please enter a non-negative integer")
- continue
- else:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement