Tuesday, July 29, 2014

Day 115

Python at CodeCademy. Worked on Python tutorial 3 of 7, Taking a Vacation: Getting There!
Worked on defining functions that accept a string as an argument.

The code used:
def hotel_cost(nights):
    return 140 * nights
def plane_ride_cost(city):
    if city == "Charlotte":
        return 183

    elif city == "Tampa":
        return 220

    elif city == "Pittsburgh":
        return 222

    elif city == "Los Angeles":
        return 475

There was no interaction for this code:

No comments:

Post a Comment