Mapa mental
Assignment one Questions
Contenido del mapa
Assignment one Questions
Q1) How does the random.randint(_,_) work?
- This function works by creating a random integer equal to or in between the numbers within the parentheses.
Q2) What is "random" and what is the purpose of using the period (.) before randint?
- Random is a module within python that calls a random number. The period before randit is way to call the method of using the random module.
Q3) What does the function print(_) do in the next line of code?
- The print function prints a specified method to the screen. The message is within the parentheses and can be just text or it could be a string.
Q4) What is the purpose of the (+) operator in the next line of code?
- The purpose of the (+) operator is to add more things to the print after the parentheses were already closed.
Q5) What is the purpose of the function str(_) in the next line of code?
- The purpose of the str(_) is to convert the integer into a string so it can be printed as the print function displays strings
Q6) Is this variable (largest) global or local? Why?
- The variable (largest) is local as it only exists within the function
Q7) What does None mean?
- None is a value that signifies empty of that there is no value in that spot
Q8) What is inputValue? Why is it necessary for this function?
- InputValue is a function that allows a prompt to be made that allows the user to type any value in the code. It is necessary for the function as we need something to compare to the random numbers.
Q9) What does return do?
- Return allows a function to return a value so for now the function returns none but after I edit the code it will return a value that is intended
Q10) What is the difference between declaring, defining, and calling a function?
- Declaring a function is the first thing you do when creating a function. It is the part where you put the "def." Defining a function is creating what the function is actually intended to do. Calling a function is what you do when you want to use that function within the code so you call for it to use it.
Q11) How was the variable message built?
- The variable message was built by adding on to each of the previous messages. They began with just "Our results are" and they kept adding on to it using the + function
Información
- Descripción
- Mapa Mental sobre Assignment one Questions, creado por Samuel Licht el 20/01/2021.
- Creado por
- Samuel Licht
- Visitas
- 0
- Valoración