Beispiel #1
0
def main():
    print("Weather research for Seattle, 2014-2015")
    print()

    research.init()

    print('The hottest 5 days:')
    days = research.hot_days()
    for idx, d in enumerate(days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_max_temp, d.date))

    print()
    print('The coldest 5 days:')
    days = research.cold_days()
    for idx, d in enumerate(days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_min_temp, d.date))

    print()
    print('The wettest 5 days:')

    days = research.wet_days()
    for idx, d in enumerate(days[:5]):
        print("{}. {} inches of rain on {}".format(idx + 1,
                                                   d.actual_precipitation,
                                                   d.date))
def main():
    print("Weather research for Seattle, 2014-2015")
    print()
    profiler.enable()

    research.init()

    hot_days = research.hot_days()
    cold_days = research.cold_days()
    wet_days = research.wet_days()

    profiler.disable()

    print("The hottest 5 days:")
    for idx, d in enumerate(hot_days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_max_temp, d.date))
    print()
    print("The coldest 5 days:")

    for idx, d in enumerate(cold_days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_min_temp, d.date))
    print()
    print("The wettest 5 days:")

    for idx, d in enumerate(wet_days[:5]):
        print("{}. {} inches of rain on {}".format(idx + 1, d.actual_precipitation, d.date))
def main():
    print("Weather research for Seattle, 2014-2015")
    print()

    # TODO: Initialize the data
    research.init()
    #print(research.data)

    print("The hottest 5 days:")
    days = research.hot_days()
    #TODO: Show the days, creating a function that gives the hottest 5 days
    for idx, d in enumerate(days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_max_temp, d.date))

    print()
    print("The coldest 5 days:")
    days = research.cold_days()
    #TODO: Show the days
    for idx, d in enumerate(days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_min_temp, d.date))

    print()

    print("The wettest 5 days:")
    #TODO: Show the days
    days = research.wet_days()
    # TODO: Show the days
    for idx, d in enumerate(days[:5]):
        print("{}. {} F on {}".format(idx + 1, d.actual_precipitation, d.date))
Beispiel #4
0
def main():
    print(f'Weather data for Seattle, 2014-2015')
    print()

    # Initialize the data
    research.init()

    print('The hottest 5 days:')
    days = research.hot_days()
    for idx, d in enumerate(days[:5]):
        print(f'#{idx + 1}, {d.actual_max_temp} F on {d.date}')

    print()

    print('The coldest 5 days:')
    days = research.cold_days()
    for idx, d in enumerate(days[:5]):
        print(f'#{idx + 1}, {d.actual_min_temp} F on {d.date}')

    print()

    print('The wettest 5 days:')
    days = research.wet_days()
    for idx, d in enumerate(days[:5]):
        print(
            f'#{idx + 1}, {d.actual_precipitation} inches of rain on {d.date}')
Beispiel #5
0
def main():
    print("Weather research for Seattle, 2014-2015")
    print()
    research.init()

    print("The hottest 5 days:")
    days = research.hot_days()
    for idx, day in enumerate(days[:5], 1):
        print(f'{idx}. {day.actual_max_temp} on {day.date}')
    print()

    print("The coldest 5 days:")
    days = research.cold_days()
    for idx, day in enumerate(days[:5], 1):
        print(f'{idx}. {day.actual_min_temp} on {day.date}')
    print()

    print("The wettest 5 days:")
    days = research.wet_days()
    for idx, day in enumerate(days[:5], 1):
        print(f'{idx}. {day.actual_precipitation} on {day.date}')
    print()
Beispiel #6
0
def main():

    print("Weather research for Seattle, 2014-2015")
    print()
    research.init()

    print("The hottest 5 days: ")
    days = research.hot_days()
    for idx, d in enumerate(days[:5], start=1):
        print(f"{idx}. {d.actual_max_temp} F on {d.date}")
    print()

    print("The coldest 5 days: ")
    days = research.cold_days()
    for idx, d in enumerate(days[:5], start=1):
        print(f"{idx}. {d.actual_min_temp} F on {d.date}")
    print()

    print("The wettest 5 days: ")
    days = research.wet_days()
    for idx, d in enumerate(days[:5], start=1):
        print(f"{idx}. {d.actual_precipitation} inches of rain on {d.date}")
    print()
Beispiel #7
0
import research

print("Weather research")

print("The hottest 5 days")
days = research.hot_days()
for i, day in enumerate(days[:5], start=1):
    print(f"{i}. {day.actual_max_temp} F on {day.date}")

print("The coldest 5 days")
days = research.hot_days()
for i, day in enumerate(days[:5], start=1):
    print(f"{i}. {day.actual_min_temp} F on {day.date}")

print("The wettest 5 days")
days = research.wet_days()
for i, day in enumerate(days[:5], start=1):
    print(f"{i}. {day.actual_precipitation} inch on {day.date}")