Skip to content

Instantly share code, notes, and snippets.

View NawshinKeya's full-sized avatar

Nawshin Keya NawshinKeya

View GitHub Profile
# rainfall_mi is a string that contains the average number of inches of rainfall in Michigan for every month (in inches) with every month separated by a comma.
# Write code to compute the number of months that have more than 3 inches of rainfall.
# Store the result in the variable num_rainy_months. In other words, count the number of items with values > 3.0.
# Hard-coded answers will receive no credit.
rainfall_mi = "1.65, 1.46, 2.05, 3.03, 3.35, 3.46, 2.83, 3.23, 3.5, 2.52, 2.8, 1.85"
rainfall_mi_split = rainfall_mi.split(",")
num_rainy_months = 0
for x in rainfall_mi_split:
x = float(x)
#For each word in the list verbs, add an -ing ending. Save this new list in a new list, ing
verbs = ["kayak", "cry", "walk", "eat", "drink", "fly"]
ing=[]
for words in verbs:
ing.append(words+'ing')
print (ing) #we will find the answer.