Page 32 - PlusGPT_V2.1_C8_Flipbook
P. 32
d. The if statement executes a command if the provided condition evaluates
to true. ____________
4. Answer the following:
a. What is decision making statement?
_____________________________________________________________________________________
_____________________________________________________________________________________
b. Write the syntax of the if statement.
_____________________________________________________________________________________
_____________________________________________________________________________________
c. Draw the flowchart for if...else statement.
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
d. Write a Python program to convert centimeters to inches. (Hint: 1 inch = 2.54 cms)
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
fun Zone
Let's soLve
Computational Thinking
What will be the output of the following programs?
1. a = int ( input ( "Enter a First Number: " ) )
b = int ( input ( "Enter a Second Number: " ) )
if a > b :
print ( "First number is greater than second number " )
else :
print ( "Second number is greater than first number " )
2. num = 44
if num % 2 == 0:
print(num, "is Even")
else:
print(num, "is Odd")
30 Premium Edition-VIII

