¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Assignment 1 Questions

Liz King Inglés

Contenido del mapa

Assignment 1 Questions

  1. Q1 random.randint(_,_)

    • Calling the method random.randint(_,_) returns an integer within a specified range.
      • EXAMPLE: random.randint(7,15) will return a number within the range 7 and 15.
      • random.randit(integer starting position, integer ending position)
  2. Q2 What is random?

    • What is the purpose of using the period before randint?
      • Designates that randint is a method within the random module in the Python Standard Library
      • The period sometimes relates to dot notation with objects
    • Random is a module that offers different methods related to pseudo-random number generators.
  3. Q3 print(_)

    • creates an output: the message within the () and makes it visible on the user's screen when ran
      • If the message is any other object than a string, then it will be converted into a strong before being printed
  4. Q4 The (+) Operator

    • serves to concatenate different parameters within the print() function into one to-be-printed string
      • In the next line of code specifically, the (+) operator connects the different string objects (formed from the randomly generated integers) into one string
  5. Q5 The str(_) function

    • transforms an object or value into a string
      • In the next line of code specifically, the str(_) function transforms a randomly generated integer into a string
  6. Q6 Variable Largest (global or local?)

    • local since the variable is declared within the method getLargestRandom()
  7. Q7 None

    • equivalent to null, no value
    • None is not equal to 0 and should be considered it's own individual DataType
  8. Q8 inputValue

    • given to the function as an argument
    • When the user calls countGreaterEqualNumbers,an input value is passed along that can be used within the function
    • NECESSARY since the function uses this inputValue to make decisions and return a value
  9. Q9 Return

    • gives a value back when a function is called
    • return will give the value for smallestOdd when the function getSmallestOddRandom() is called
  10. Q10 Differences between declaring, defining,and calling a function

    • DECLARING
      • lists the function's name, return type, and parameters
    • DEFINING
      • forms the actual body of it, meaning all the code inside is written
        • Often you declare and define a function at the same time, though they differ since you can declare a function without defining it
    • CALLING
      • only requires the function to have a name and specify the parameters to be used
  11. Q11 Variable Message

    • built by calling different functions concatenating their return values using the (+) operator
    • The message variable adds more to itself and uses an escape character '\n' to create a new line

Información

Descripción
Mapa Mental sobre Assignment 1 Questions, creado por Liz King el 25/01/2021.
Creado por
Liz King
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?