Question
Question 21 Assuming the variables a, b, c, and d, are all floating point numbers, which of the following calculations will compute the average accurately?
Question 21
Assuming the variables a, b, c, and d, are all floating point numbers, which of the following calculations will compute the average accurately?
average = (a + b + c + d / 4) |
average = a + b + c + d / (4) |
average = (a + b + c + d) / 4 |
average = a + b + c + d / 4 |
Flag this Question
Question 22
In Python, the symbol for comparing two things to see if they are equal is
<> |
= |
== |
<=> |
Flag this Question
Question 23
In Python, if-statements end with the following symbol
' |
= |
. |
: |
Flag this Question
Question 24
In Python, indenting statements that should be performed only if the if-statement condition is true is to improve readability only; it doesn't affect the execution of the code.
True |
False |
Flag this Question
Question 25
The str() function converts numeric variables to text.
True |
False |
Flag this Question
Question 26
The number -2 is less than the number -1 whether it is stored as a number or as text.
True |
False |
Flag this Question
Question 27
When sorting names alphabetically in Python, a name that starts with an uppercase letter will be listed after the same name that starts with a lowercase letter.
True |
False |
Flag this Question
Question 28
Rounding with the format operator converts a value from a number to text.
True |
False |
Flag this Question
Question 29
Comments cannot be placed on the same lines as program statements.
True |
False |
Flag this Question
Question 30
The variable naming convention called lowerCamelCase used in Python is
the first letter of each word in the variable name should be upper case except the first letter of the first word which should be lower case |
all letters should be lower case |
all letters should be upper case |
the first letter of each word in the variable name should be upper case |
Flag this Question
Question 31
Which of the following statements will produce a syntax error?
print("I'm undecided , about a major") |
print('I'm undecided about a major.') |
print (" I'm undecided about a major.") |
print("I'm undecided about a major.") |
Flag this Question
Question 32
Which of the following statements will NOT produce a syntax error?
if x > y |
if x = y; |
if x == y, |
if x < y: |
Flag this Question
Question 33
Code for creating a new variable by concatenating text strings goes in the
comments code block |
variable code block |
output code block |
calculations code block |
Flag this Question
Question 34
If-statements go in the
variable code block |
output code block |
calculations code block |
comment code block |
Flag this Question
Question 35
Code for input statements goes in the
output code block |
variable code block |
comments code block |
calculations code block |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started