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

Mind map

CIS4930 Assignment #1

Sara Loving English

Map content

CIS4930 Assignment #1

  1. Global Variables

    • Q1: How does the random.randint(_,_) work?
      • The random.randint(_,_) generates a random number between two integer values that are specified between the brackets.
      • When specifying the two bounds for the random integer, the upper and lower limits are included.
    • Q2: What is "random" and what is the purpose of using the period (.) before randint?
      • "Random" means that the number returned will not follow a pattern or be dependent on another number. Each number in the range will have the same probability of being chosen.
      • The purpose of using the period before randint is so that Python knows that the method is from the random module.
    • Q3: What does the function print(_) do in the next line of code?
      • Print() prints the message into the PyCharm console, dependent on the values of the random numbers.
    • Q4: What is the purpose of the (+) operator in the next line of code?
      • The purpose of the (+) operator is to add an object into the string.
      • In this case, the (+) operator is used to add in the random number values as well as to add spaces in between them.
    • Q5: What is the purpose of the function str(_) in the next line of code?
      • The purpose of the function str(_) is to convert the random integers to type string.
  2. Functions' declaration and definition

    • Q6: Is this variable (largest) global or local? Why?
      • The variable largest is local because it is defined within the function and cannot be accessed outside the function.
    • Q7: What does None mean?
      • None is used to indicate that a variable has no defined value.
    • Q8: What is inputValue? Why is it necessary for this function?
      • inputValue is the argument for the function.
      • It is necessary for the function because we need to define a value that we can compare the random numbers to in order to see which numbers are greater than and equal to the inputValue.
    • Q9: What does return do?
      • Return gives a value and a type to the object returned by the function.
      • It also stops the execution of the function.
  3. Function calls

    • Q10: What is the difference between declaring, defining, and calling a function?
      • Declaring a function involves providing information about the properties of the function, such as the arguments it takes.
      • Defining a function involves telling Python how to execute the function given the arguments you have provided.
      • Calling a function is completed by typing the function name followed by parentheses and the parameters involved in the function.
    • Q11: How was the variable message built?
      • The variable message was built by combining multiple strings.

Information

Description
Mind Map on CIS4930 Assignment #1, created by Sara Loving on 01/17/2021.
Created by
Sara Loving
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?