The exam approaches. What else would you like to have practice with? What thing in python do you struggle with the most? Pick one or more options below. We can do any of these together in class. You can also pick ANY of the previous in-class activities.
Create a file exam2-practice.py
and save to your cs100/ch5
folder.
listA
that contains 10 random numbers.listB
that contains 10 random numbers1
is in the lista=[1, 2, 3, 4, 1, 2, 3, 1, 3, 1, 2, 4, 5, 1, 2, 3, 6, 7, 3, 3, 1]
. Compute the mean, median, and mode, and calculate the frequency distribution.Enter next number (negative number to stop): 5
Enter next number (negative number to stop): 10
Enter next number (negative number to stop): 3
Enter next number (negative number to stop): -1
Sum of all positive numbers: 18
numbers.txt
and write to it the first 100 numbers using a while loopscores.txt
. Use a while loop to prompt the user to type in student names and corresponding scores to write to the file. End the program when the user types q
.http://csweb.wooster.edu/hguarnera/cs100/assignments/rainfall.txt
. Output the contents of the page to the terminal decoded in UTF-8 format.Cool beans. Pick 5 questions from above and complete them independently.
Save your working python file and submit to Moodle.