GoConqr has a new look! Let us know what you think.

Mind map

Mumme: CIS 4930: Assignment 1 Part 1

Nicholas Mumme English

Map content

Mumme: CIS 4930: Assignment 1 Part 1

  1. Question 1

    • How does the random.randint(_,_) work?
      • It selects a random integer within the range set by the numbers in the parenthesis.
  2. 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."
  3. 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.
  4. 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.
  5. Question 6

    • Is this variable (largest) global or local? Why?
      • Largest is a local variable as it is only defined within the getLargestRandom() function
  6. 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.
  7. Question 7

    • What does None mean?
      • None is used to define a lack of value (ie, a null value).
  8. 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.
  9. Question 9

    • What does return do?
      • "return" is what a given function returns back to the caller after function is complete.
  10. 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.
  11. 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.

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

More on Python Functions

Feedback

What is it about?

What do you think of the new look?

How do you like it?