GoConqr has a new look! Let us know what you think.

Mind map

Assignment one Questions

Samuel Licht English

Map content

Assignment one Questions

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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
  6. Q6) Is this variable (largest) global or local? Why?

    • The variable (largest) is local as it only exists within the function
  7. Q7) What does None mean?

    • None is a value that signifies empty of that there is no value in that spot
  8. 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.
  9. 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
  10. 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.
  11. 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

Information

Description
Mind Map on Assignment one Questions, created by Samuel Licht on 20/01/2021.
Created by
Samuel Licht
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?