Skip to content

Instantly share code, notes, and snippets.

@lushiv
Created November 14, 2022 14:56
Show Gist options
  • Save lushiv/32faf94922b4625315c343ce360bcb1b to your computer and use it in GitHub Desktop.
Save lushiv/32faf94922b4625315c343ce360bcb1b to your computer and use it in GitHub Desktop.
Assignment: Measuring vertical and horizontal length of hiking trips
## Assignment: Measuring vertical and horizontal length of hiking trips
# user can input the (i) name of a trip/mountain
print("Start the Script: [start]")
print("Stop the Script: [end]")
cmd = input("Enter your command: ")
cmd_list = []
cmd_list.append(cmd)
final_result = []
while 'start' in cmd_list:
name_of_trip = input("Enter name of a trip/mountain: ")
length_of_the_trip = input("Enter the length of the trip in kilometers: ")
trip_in_total = input("Enter the vertical climb of the trip in total: ")
final_result.append({
"name_of_trip" : name_of_trip,
"length_of_the_trip": length_of_the_trip+' '+'Km',
"vertical_climb_of_the_trip_in_total": trip_in_total
})
print("If you want the continue script: [start]")
print("If you want the Stop the Script: [end]")
cmd = input("Enter your command: ")
cmd_list = []
cmd_list.append(cmd)
print(final_result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment