Mindmap
Q1: How does the random.randint(_,_) work?
Inhalt der Mindmap
Q1: How does the random.randint(_,_) work?
A1: It works by returning a random integer between (and including) the upper and lower limits.
- Q2: What is “random” and what is the purpose of using the period (.) before randint?
- A2: “random” is a module. randint is a method. The period is used to separate them.
- Q3: What does the function print(_) do in the next line of code?
- A3: Print will display the content of the parenthesis in the terminal. It will also display the values of the strings.
- Q4: What is the purpose of the (+) operator in the next line of code?
- A4: The (+) operator concatenates the strings so they are all displayed as the same sentence.
- Q5: What is the purpose of the function_str(_) in the next line of code?
- A5: The str function casts the variable type into a string so that it can be printed.
- Q6: Is the variable (largest) global or local? Why?
- A6: Largest is a local variable because it is defined only within the function.
- Q7: What does None mean?
- A7: None is the absence of value.
- Q8: What is inputValue? Why is it necessary for this function?
- A8: Input value takes a random number within the range and inputs it to the function.
- Q9: What does return do?
- A9: Return leaves the current function and returns a value.
- Q10: What is the difference between declaring, defining, and calling a function?
- A10: Declaring a function makes it exist. Defining a function is how you make it do something. Calling a function makes it execute.
- Q11: How was the variable message built?
- A11: It is concatenated with a string function.
- Q11: How was the variable message built?
- A10: Declaring a function makes it exist. Defining a function is how you make it do something. Calling a function makes it execute.
- Q10: What is the difference between declaring, defining, and calling a function?
- A9: Return leaves the current function and returns a value.
- Q9: What does return do?
- A8: Input value takes a random number within the range and inputs it to the function.
- Q8: What is inputValue? Why is it necessary for this function?
- A7: None is the absence of value.
- Q7: What does None mean?
- A6: Largest is a local variable because it is defined only within the function.
- Q6: Is the variable (largest) global or local? Why?
- A5: The str function casts the variable type into a string so that it can be printed.
- Q5: What is the purpose of the function_str(_) in the next line of code?
- A4: The (+) operator concatenates the strings so they are all displayed as the same sentence.
- Q4: What is the purpose of the (+) operator in the next line of code?
- A3: Print will display the content of the parenthesis in the terminal. It will also display the values of the strings.
- Q3: What does the function print(_) do in the next line of code?
- A2: “random” is a module. randint is a method. The period is used to separate them.
- Q2: What is “random” and what is the purpose of using the period (.) before randint?
Informationen
- Beschreibung
- Mindmap am Q1: How does the random.randint(_,_) work?, erstellt von Austin Ross am 25/01/2021.
- Erstellt von
- Austin Ross
- Aufrufe
- 0
- Bewertung