"In Python Code Only"

Hey guys, I need help in this exercise, actually I do have a part of the exercise but I'm lacking of creativity, and now I'm struggling to keep up on the assignment.

If could get an explanation on where to change or even to start from the beginning, doesn't matter, have a good one (I accept critics as well, I just recently started learning this language):

Create a program that assigns a random integer to the total rainfall for a calendar year, Using a dictionary to store the month and random rainfall.

- Do NOT use the month_list = ["January", "February", "March",month_list = ["January", "February", "March", etc. hardcoded month list we used in the previous assignment.

- All the work including appending rainfall must be done using a dictionary. Do NOT use the built in dict() conversion. It defeats the purpose of the lesson and will earn no credit.

- The random.randint function for assigning rainfall to the months can only appear ONCE in your code. Multiple instances will result in a zero for the assignment.

- Instead of the aforementioned list use a dynamically created list using the datetime module see sample https://onlinegdb.com/NwOa3CLtO (Links to an external site.)

-The same rules apply maximum rain in a month 4 inches.

- Use | as a separator in the minimum and maximum strings vs comma we used in the past.

- You will need to print the dictionary, results, and an output file called randout.txt. This output file will contain the same data as your dictionary stored in random order. The randomizing of the output data must be done using random.choice (Links to an external site.) function. Make sure you don't confuse random.choice with random.choices. To avoid duplication you will have to remove (pop) the values out of the dictionary one by one once they are printed. The random output file will have 12 unique values that match the dictionary.

- The code must be modularized and use functions. No functions no points. Constants such as MAXRAIN should be at the top outside any defined (def) functions.
- The remaining code must either be inside defined (def) functions.
- The only exception is if __name__ == "__main__": or similar which calls the first function to execute.

- The code needs to include at least functions to generate rain, print results, and write to file.

- If you have a dictionary and need a list to use in the random,choice function you may use the built in list().)

key = random.choice(list(month_dict))

In Python Code Only Hey guys I need help in this exercise actually I do have a part of the exercise but Im lacking of creativity and now Im struggling to keep u class=
In Python Code Only Hey guys I need help in this exercise actually I do have a part of the exercise but Im lacking of creativity and now Im struggling to keep u class=


Answer :

Other Questions