Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def readAllData01(List_of_data01):
- result=[]
- with open(List_of_data01,'r') as file_n:
- for i in file_n.readlines():
- result.append(tuple(i.split()))
- return result
- def readAllData02(List_of_data02):
- result=[]
- with open(List_of_data02,'r') as file_n:
- for i in file_n.readlines():
- result.append(tuple(i.split()))
- return result
- def input_(List_of_data01=None,List_of_data02=None):
- print(len(List_of_data01))
- Current_location = input("Enter your current location : ")
- Location_traveling = input("Enter your location : ")
- No_of_passengers = input("Enter passengers : ")
- print(Current_location,Location_traveling,No_of_passengers)
- for i in List_of_data01:
- if i[7] == Current_location:
- if i[6]<=No_of_passengers:
- print("Driver Name = ",i[0])
- print("Driver Phone Number = ",i[1])
- print("Driver Rating = ",i[10])
- else:
- print("Sorry! No Car is available in your location right now")
- if __name__=='__main__':
- List_of_data01=readAllData01('uber_drivers.txt')
- List_of_data02=readAllData02('location.txt')
- print("List Of Driver =: ")
- print(List_of_data01)
- print(end="")
- print("List of Location : ")
- print(List_of_data02)
- client_input = input_(List_of_data01,List_of_data02)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement