Mapa mental
Mental Map 1
Conteúdo do mapa
Mental Map 1
#Q1: How does the random.randint(_,_) work?
- The random.randint(x,y) function returns a random integer in between bounds x and y.
- #Q2: What is "random" and what is the purpose of using the period (.) before randint?
- "random" represents the imported library that contains many functions. The period (.) separates the function from the # library that it is called from
- #Q3: What does the function print(_) do in the next line of code?
- print(_) prints the inside code in the window when the line is ran.
- #Q4: What is the purpose of the (+) operator in the next line of code?
- The (+) operator concatenates the code so that the print function will include the different data types.
- #Q5: What is the purpose of the function str(_) in the next line of code?
- str(_) converts an object to a string
- #Q6: Is this variable (largest) global or local? Why?
- largest is a local variable since it can only be used within the getLargestRandom() function
- #Q7: What does None mean?
- None is a data type that is equivalent to no value
- #Q8: What is inputValue? Why is it necessary for this function?
- inputValue is the randomly generated number that will be used as the comparison for each conditional statement
- #Q9: What does return do?
- return tells the function what the output value should be
- #Q10: What is the difference between declaring, defining, and calling a function?
- Declaring is the same as creating a function
- Defining a function is using the def keyword to create and name a function
- # Q11: How was the variable message built?
- The variable message was built through string concatenation, with a mixture of strings and variables that are added # together in the end to form a final message
- # Q11: How was the variable message built?
- Calling a function means using the function in the code and can be called by using the name and parentheses with arguments inside
- #Q10: What is the difference between declaring, defining, and calling a function?
- return tells the function what the output value should be
- #Q9: What does return do?
- inputValue is the randomly generated number that will be used as the comparison for each conditional statement
- #Q8: What is inputValue? Why is it necessary for this function?
- None is a data type that is equivalent to no value
- #Q7: What does None mean?
- largest is a local variable since it can only be used within the getLargestRandom() function
- #Q6: Is this variable (largest) global or local? Why?
- str(_) converts an object to a string
- #Q5: What is the purpose of the function str(_) in the next line of code?
- The (+) operator concatenates the code so that the print function will include the different data types.
- #Q4: What is the purpose of the (+) operator in the next line of code?
- print(_) prints the inside code in the window when the line is ran.
- #Q3: What does the function print(_) do in the next line of code?
- "random" represents the imported library that contains many functions. The period (.) separates the function from the # library that it is called from
- #Q2: What is "random" and what is the purpose of using the period (.) before randint?
- The random.randint(x,y) function returns a random integer in between bounds x and y.
Informações
- Descrição
- Computer Science Mapa Mental sobre Mental Map 1, criado por Sam Beazley em 25-01-2021.
- Criado por
- Sam Beazley
- Visualizações
- 2
- Avaliação