How do you make sure that the variable value entered by a user is a number?


#1



https://www.codecademy.com/en/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096

I just want to make sure that the value of the variable 'city' entered by the user is not a number. How do I do that?


nights = input("Tell us the no. of nights you want to spend on the vacation") 
def hotel_cost(nights) : 
    return nights * 140 
print hotel_cost(nights) 

city = input("Please tell us which city you want to visit")
def plane_ride_cost(city) :
    if city = number :
        return "Sorry Enter a Valid City " 
        city = input("Please tell us which city you want to visit")
    elif city.lower()== "charlotte" :
        return 183
    elif city.lower() == "tampa" :
        return 220 
    elif city.lower() == "pittsburgh" :
        return 222
    elif city.lower() == "los angeles" :
        return 475 
    else : 
        return "Sorry! Not a Valid City"
print plane_ride_cost(city)
days = input("Tell us the no. of days you will require a rental car")
def rental_car_cost(days) :
    if days < 7:
        return 40 * days
    elif days <= 3:
        return 40*days - 20
    elif days <= 7 :
        return 40 * days - 50
print rental_car_cost(days)


#2

that is not a easy one, you would get something like this:

if all(x.isalpha() or x.isspace() for x in city):

if spaces wheren't allowed, things would be much is easy (if city.isalpha():), but spaces must also be allowed