andonyan

05 - Travelling

Oct 30th, 2020
765
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. while True:                                    
  2.     destination = input()                      
  3.     if destination == 'End':                  
  4.         break                                  
  5.     else:                                      
  6.         required_sum = float(input())          
  7.         gathered_sum = 0                      
  8.         while gathered_sum < required_sum:    
  9.             gathered_sum += float(input())    
  10.         else:                                  
  11.             print(f'Going to {destination}!')  
Advertisement
Add Comment
Please, Sign In to add comment