Question: please help using python code. Write a function randontuanbers with two parkmeters upTo and num. The function will generate man integers each between 1 and

please help using python code.
 please help using python code. Write a function randontuanbers with two
parkmeters upTo and num. The function will generate man integers each between

Write a function randontuanbers with two parkmeters upTo and num. The function will generate man integers each between 1 and up to. These integers should be added to a set (oot a lattl). At the end the function returns the number of unique numbers generated (which corresponds to the siae of the set. If the function teturns the same as num it means that al generated numbers were difterent, but if the number returned is less than nus than it means that arandom number was selected more than once. If you try the function with upTo =365, then this is the same as choosing birthdates randorely. What value should you give to nut to have a high chance of getting the same birthday taice lthe function teturns less than nuel? Try for cxample, 10, 25, 30,100. Sample run. While drawing 10 randon numbers betueen 1 and 365 , ine obtained 1e different nusbers, and o collasions. While oraking 25 randen nuebers between 1 and 365, we obtained 24 alfferent nubers, and. 1 colluslons. While drawing 50 randon. numbers hetween 1 and 365 , we obtained 45 different numbers, and 5 colluslens. While draulng 10e random nunbers between i and 365 , we abtained g9 diffecent numbers, and 11 collusions, While drautice 188 random numbers betieeen 1 and 365 , we obtained 146 diffeeent numbees, and 34 colluslons. Exeroise 2 Back to the basicsi Write a program that asks the uier the number of coures he is takine this semester, then asks the ver to enter the course codes and amdes, and finally prints the average of the grades thes semester. No need for input valdation in this eactcisel Exercise 3 Actually, not all courses have the same weight: the weight depends on the credit value. Modify the previous code to request the credit value of each course and compute the weighted average: the weighted average represents the sum of the grades multiplied by their credit value divided by the sum of all credits. Here is a sample run: Enter the number of courses that you are taking this semester: 4 Enter the course code for course =1: corrtie2e Enter the number of credits of commieze: 3 Enter the grade obtained in corvele2e: 92 Enter the course code for course =2 : INF512e1 Enter the number of credits of IMFS12e1: 4 Enter the grade obtained in INFS12e1: 78 Enter the course code for course =3: INFT12e1 Enter the number of credits of INFT12e1: 4 Enter the grade obtained in INFT12e1: 96 Enter the course code for course =4: MATHe3e Enter the number of credits of MATH1e3e: 3 Enter the grade obtained in MATHLese: 86 Your average for this senester is: 87.85714285714286 Exercise 4 At UDST, the GPA is a weighted average, not of the grades directly but of grade points. Grade points are converted from grades According to the below table: Add to the previous code, a function gradezGP that takes a grade as input and returns the corresponding grade point. Use this function to compute the semester GPA. Here b a sample run: Enter the number of courses that you are taking this senester: 4 Enter the course code for course =1: corvieze Enter the number of credits of compie2e: 3 Enter the grade obtained in comp1e28: 92 Enter the course code for course =2: INFS12e1 Enter the number of credits of INFS12e1: 4 Enter the grade obtained in INFS12e1: 78 Enter the course code for course =3: INFT12e1 Enter the nunber of credits of INFT12e1: 4 Enter the grade obtained in INFT12e1: 96 Enter the course code for course a4: MATH1e3e Enter the number of credits of MATHie3e: 3 Enter the grade obtained in MATH1e3e: 86 Vour seester GPA is: 3.4642857142857144

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!