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

Mindmap

PYTHON

Jackie Golabek Englisch

Inhalt der Mindmap

PYTHON

  1. Q1: random.randint(,) works in that the user sets the range of values in which the computer will pick a random integer in that range (inclusive).

  2. Q2: "random" is the python function to select a random number in a specified range. The period (.) and randint specifies that the range "random" applies to must be a random integer.

  3. Q3: print() outputs the string "The numbers generated are: " + str(randomNumberA) +" "+ str(randomNumberB) +" "+str(randomNumberC) +" "+ str(randomNumberD) +" "+ str(randomNumberE), where the "str(randomNumberX)" represents the variable called randomNumberX in string form. If randomNumberA = 2, randomNumberB = -30, randomNumberC = 145, randomNumberD = 1, and randomNumberE = 1666, then the response returned via print() would be as follows: The numbers generated are: 2 -30 145 1 1666

  4. Q4: The (+) operator combines the specified components into a single response.

  5. Q5: The str() function makes the variable within the parenthesis () outputted as a string value.

  6. Q6: The variable "largest" is local as it is defined within the function definition and will not be used outside the function definition. This is used for this function definition as "largest = None" is initializing the variable for later use.

  7. Q7: None means nothing (i.e. no number/string/value) is defined as the variable value specified.

  8. Q8: InputValue is a placeholder such that when the function countGreaterEqualNumbers() is used, whatever is in the parenthesis () will be specified as InputValue and can be used per the lines of code that use the InputValue variable. In this function, inputValue is defined when the function is called, for example if countGreaterEqualNumbers(5) was written in the code, then inputValue is 5 and the function will use that variable to determine if the randomNumberX variables are smaller then that number.

  9. Q9: The return command outputs the variable valule that follows it. In this function, the smallest odd number determined by the function is outputted as the solution to the function getSmallestOddRandom() .

  10. Q10: The function must first be declared (i.e. named) using the def command. Following the naming of the function, the function is then defined per instructions the user specifies under the def functionName line. A function is called when the function has already been defined and the function name is then listed with a specified argument within the parenthesis.

  11. Q11: The variable message was defined as an initial string and then combined with additional strings to finally mean a string of the largest, smallest, count of the greater/equal, existence of smallest odd, and the average numbers. For example if the random values were 6 -15 79 1331 -89, then the message would be defined as follows: Our results are: 1) The largest number is: 1331 2) The smallest number is: -89 3) There are 2 numbers greater than 16 4) The smallest odd number is: -89 5) The average is: 262.4

  12. Function

  13. Variable

    • Global
    • Local
  14. Value

    • String
    • Float
    • Integer
    • None
  15. Operator

Informationen

Beschreibung
Mindmap am PYTHON, erstellt von Jackie Golabek am 24/01/2021.
Erstellt von
Jackie Golabek
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck