Create a script that will take a user input, find the factors of that number, and print those factors.
- It would be sad if you don’t know what factors are, but here you go
- Use a list to store the factors you have found
- Use a loop to check each possible factor
- Use the function
input()to collect a user’s input
- That input is going to be a string, turn it into an integer
Here is the possible output of a function:
Create a script that can generate a fraction consisting of 10 unique numbers on the numerator and 10 unique numbers on the denominator that can be a close approximation of PI. So, each number (1,2,3,4,5,6,7,9,0) can only be used once in the numerator and same for the denominator.
- You will probably use random numbers (
import random) for either the denominator or the numerator
- Use a list for creating the random unique numbers
- Also, add the math module, it contains PI
- You will probably use loops
- This is simpler than you think
This is one of the many answers that could be generated through a good script:
We have been given some file transfer data from the NOvA experiment. These data files contains a lot of information about file transfers for this experiment. We are going to take how many jobs started in one day. We will then plot this data in a histogram with the bin size being 1 hour.
Here is the header which has been removed from the csv file,
- Take a look at the matplotlib histogram script you did in the lesson
- Most of the data in the data file for what we are trying to do is irrelevant, pay attention just to how many jobs were in a particular hour
- To find this, you are given a jobStartTime which is a unix timestamp, lookup how to get an hour of the day from this timestamp, then count how many are in each hour