Lesson 3.1 - Built-in Functions and Custom Functions with no Argument
- Functions
- Import the random library with one line of code at the top of your script: import random
- Read documentation on the random library here: Python random library
- Be able to generate a random integer by calling: random.randint(x,y)
- Be able to generate a random probability (0 <= p <= 1) by calling: random.random( )
- Import the math library with one line of code at the top of your script: import math
- Read documentation on the math library here: Python math library
- Define functions with no argument variable
- Learn to call these functions changing elements
- Know the return value of your functions
Note on multi-line lists:
The closing brace/bracket/parenthesis on multi-line constructs may line up under the first non-whitespace character of the last line of list, as in:
my_list = [1, 2, 3, 4, 5, 6,]
Due Wednesday February 26, 2020 :
- 3.1 - Reading: Math Functions, Compositions of Fns.
- Do these labs on repl.it:
- 3.1a isPositive()
- 3.1b isEven()
- 3..1c minimum()
No comments:
Post a Comment