with 100% Correct Answers
When will you use bool values in your programs? - Answer-When making logical
decisions
Which of the following statements are true about expressions?
1. Every expression will evaluate to a value
2. Every expression evaluates to a specific value
3. Anywhere you can write an expression that evaluates to one type, you could write
another expression in its place as long as it evaluates to the same type and still have a
validly typed program - Answer-1,2,3
Which operator is used to raise one number to the power of another? - Answer-**
Which operator is used for integer division and results in an int typed value? - Answer-//
What operator is used to find the remainder of an integer division calculation and results
in an int typed value? - Answer-%
Comparing two string values using relational operators always works the way you would
expect it to in the English Language - Answer-False
Which of the following relational operators tests whether two values are equal to one
another? - Answer-==
The random package has many functions for generating random numbers. There's a
random function defined in the random package, you can import and call using a
function call expression like so:
>>> from random import random >>> random()
Try calling the random function many times. What type does a call to the random
function evaluate to? - Answer-<class 'float'>
The random package also has many functions for random selections. There's a choice
function defined in the random package, you can import and call using a function call
expression with a sequence as an argument, like so:
>>> from random import choice >>> choice("wxyz")