GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Global Variables

Alyssa M. Englisch

Inhalt der Mindmap

Global Variables

  1. 1. How does the random.randint(_,_) work?

    • random.randint(_,_) works by returning an random integer value that is between the two numbers within the parentheses.
      • random.randint(2,10) will return a random number between and including 2 and 10.
  2. 2. What is "random" and what is the purpose of using the period (.) before randint?

    • "random" is a module that is built into python and has different methods to return random numbers. The period before randint is there to call the method within "random" to return a random integer.
      • Other "random" methods that can be called using the period includes .randrange(_,__) which returns a random number between, but not including the numbers within the parentheses.
  3. 3. What does the function print(_) do in the next line of code?

    • print(_) displays the information within the parentheses in the output once the code is run.
      • It will display something resembling: "The numbers generated are: 5 30 75 1700 -50".
  4. 4. What is the purpose of the (+) operator in the next line of code?

    • The (+) operator concatenates the strings it is between. Since the line of code is calling on global variables, the (+) operator has to be used to connect the string at the beginning of the print function to the subsequent variables.
  5. 5. What is the purpose of the function str(_) in the next line of code?

    • The function str(_) in the next line of code is casting. It creates a string data type from an integer data type.
  6. Functions, Declaration and Definition

    • 6. Is the variable (largest) global or local? Why?
      • The variable (largest) is local because the variable was created within a function.
    • 7. What does None mean?
      • None means there is no value or a null value.
    • 8. What is inputValue? Why is it necessary for this function?
      • inputValue is a parameter/argument. It is necessary for this function because the intended purpose of the function is to retrieve numbers based on a value that the user inputs.
    • 9. What does return do?
      • return "returns" the result of a function to the user. In this case, it shows return None which I believe is a placeholder for a variable.
    • Function Calls
      • 10. What is the difference between declaring, defining, and calling a function?
        • Declaring a function is when you state what data type the function is. There are no declarations in python I believe. Defining a function is creating the function. Calling a function is actually executing the code within the function.
      • 11. How was the variable message built?
        • The variable message was built by updating the string stored in the variable. In each line, more strings are added on while still preserving the original message.

Informationen

Beschreibung
Mindmap am Global Variables, erstellt von Alyssa M. am 14/01/2021.
Erstellt von
Alyssa M.
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck