I'm writing a simple program where a person can go on a trip, but the trip has to last
# hotel costs 140$ per day
return 140 * int(days)
Your can condense asking the user for the number of days, and giving them there price in in one function.
def ask_num_hotel_days(): i = int(input("Enter nuber of days: ")) while(i < 3): print(str(i) + " is not a valid number of days") i = int(input("Enter nuber of days: ")) return 140 * i