This is using Python I did it wrong please help Matching the Definition A. et of
ID: 3589050 • Letter: T
Question
This is using Python I did it wrong please help
Matching the Definition A. et of statement that belong together as a group 1. A Block 2. Boolean Expression B. an expression that evaluate to true or false 3. If Statement 4. If-else statement D.a statement that executes an alternative path if the condition is true 5. If-elif-else statement E. a statemjent that execute one block of statement if its condition is true, or another block if it is condition is false C. a statement that may be used to replace a nested I if else structureExplanation / Answer
The first macthes are correct and remaning are corrected by me Please Check the below answers
3)if statement D) a statement that excutes an alternative path if condition is true
4)if-else statement E) statement that execute one block of statement if it condition is true or another block if it is condition is false
5) if-elif-else statement: c) a statement that may be used to replace a nested if else structure
1)A Block :
i)it is a piece of Python program text that is executed as a unit.
ii)They are some of the blocks in phyton They are a module, a function body, and a class definition.
iii)Each command typed interactively is a block
2)Boolean Expression:
i)It is an expression which evaluates a boolean value .
ii)Example of one of boolean expression is print (5==5) this statement returns true .
iii)print(5==6) this statement return false
here '==' is comparision operator.
3)if statement:
i)It is a conditional statement which will activate the code inside when the condtion is satisfied
example:
if a >= 22:
print("if")
4)if else statement:
It evaluates expression and then it will execute the body if and only condition is true if condition is false it will execute the statement inside else
example:
num = -5
if num >= 0:
print("Positive or Zero")
else:
print("Negative number")
5)if -elif-else statement:
It is shorter for else if This statement will allow to check for multiple expressions
num = 3.4
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.