Mind map
Mumme: CIS 4930: Assignment 1 Part 1
Map content
Mumme: CIS 4930: Assignment 1 Part 1
Question 1
- How does the random.randint(_,_) work?
- It selects a random integer within the range set by the numbers in the parenthesis.
- How does the random.randint(_,_) work?
Question 2
- What is "random" and what is the purpose of using the period (.) before randint?
- "random" is a built-in module in Python for creating random numbers. The period allows for randint to access the module in order to complete its purpose which in this case is to create a random integer within said bounds."
- What is "random" and what is the purpose of using the period (.) before randint?
Question 3
- What does the function print(_) do in the next line of code?
- ##It allows for the words and values in and referenced within the parenthesis to be visible to the user.
- What does the function print(_) do in the next line of code?
Question 4
- What is the purpose of the (+) operator in the next line of code?
- The "+" allows for multiple items, in this case all five of the randomNumbers to be considered and in this case printed with the rest of the message.
- What is the purpose of the (+) operator in the next line of code?
Question 6
- Is this variable (largest) global or local? Why?
- Largest is a local variable as it is only defined within the getLargestRandom() function
- Is this variable (largest) global or local? Why?
Question 5
- What is the purpose of the function str(_) in the next line of code?
- str() allows the number(s) at hand, in this case the randomNumbers, to be converted into a string.
- What is the purpose of the function str(_) in the next line of code?
Question 7
- What does None mean?
- None is used to define a lack of value (ie, a null value).
- What does None mean?
Question 8
- What is inputValue? Why is it necessary for this function?
- inputValue is a specific value input by the user. It is necessary for this function as this function is specifically trying to find how many of the randomNumbers is bigger than a user input value.
- What is inputValue? Why is it necessary for this function?
Question 9
- What does return do?
- "return" is what a given function returns back to the caller after function is complete.
- What does return do?
Question 10
- What is the difference between declaring, defining, and calling a function?
- Declare: To give the the computer a specific name to refer to a given function as (ie, def calculateAverage()). Define: To specify an order of actions for the computer to perform within the given function. Call: To tell the computer to execute a function.
- What is the difference between declaring, defining, and calling a function?
Question 11
- How was the variable message built?
- For getSmallestOddRandom(), if what is returned is a null value, then "There are not odd numbers" is printed as the message. If a null value is not returned, then "The smallest odd number is <the value of the smallest odd number>" is printed instead.
- How was the variable message built?
Information
- Description
- Mind Map on Mumme: CIS 4930: Assignment 1 Part 1, created by Nicholas Mumme on 19/01/2021.
- Created by
- Nicholas Mumme
- Views
- 1
- Rating