Ответ:
Два варианта
Объяснение:
rain = 0
snow = 0
for i in range(7):
weather = input(f"What was the weather like on day {i + 1} of December? (rain/snow): ")
if weather == "rain":
rain += 1
elif weather == "snow":
snow += 1
else:
print(f"Invalid input for day {i + 1}.")
print(f"Rain fell {rain} times in December.")
print(f"Snow fell {snow} times in December.")
rain_count = 0
snow_count = 0
while True:
weather = input("Enter the weather (rain or snow): ")
rain_count += 1
print("Rain count:", rain_count)
snow_count += 1
print("Snow count:", snow_count)
print("Invalid weather type.")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
Два варианта
Объяснение:
rain = 0
snow = 0
for i in range(7):
weather = input(f"What was the weather like on day {i + 1} of December? (rain/snow): ")
if weather == "rain":
rain += 1
elif weather == "snow":
snow += 1
else:
print(f"Invalid input for day {i + 1}.")
print(f"Rain fell {rain} times in December.")
print(f"Snow fell {snow} times in December.")
rain_count = 0
snow_count = 0
while True:
weather = input("Enter the weather (rain or snow): ")
if weather == "rain":
rain_count += 1
print("Rain count:", rain_count)
elif weather == "snow":
snow_count += 1
print("Snow count:", snow_count)
else:
print("Invalid weather type.")