A statement inside ‘if’ has an indentation of _________ space
1.2
2.4
3.6
4.8
A graphical representation that shows step by step solution to solve a given problem is __
1.Algorithm
2.Flow Chart
3.Line Chart
4.Pie Chart
An ‘if’ condition inside another ‘if’ is called ___ a.
1.Second
2.nested
3.another if
4.All of the above
Correct syntax of writing ‘simple if’ statement is _____
1. if condition statements
2.if (condition) statements
3.if condition : statements
4.if condition -- statements
Execution of statements in _________________ construct depend on a condition test.
1.Selection
2.Sequence
3.Iteration
4.Repetition
if-elif statement is used in situation which involves ____________
1.multiple condition
2.exactly one condition
3.Both of the above
4.None of the above
In programming, the concept of decision making or selection is implemented with the help of ___________ statement
1.while loop
2.for loop
3. if..else
4.None of the above
Leading whitespace (spaces and tabs) at the beginning of a statement is called _______
1.indentation
2.orientation
3.Iteration
4.None of the above
Number of elif in a program is dependent on the _____
1.number of conditions to be checked
2.number of variables in a program
3.number of loops in a program
4.None of the above
Number of elif in if-elif ladder depends on _
1.number of conditions to be checked in program.
2.number of variables in program.
3.Both of the above
4.None of the above
Python executes one statement after another from beginning to the end of the program. This is a __
1.Selection Construct
2.Sequential Construct
3.Iteration Construct
4.None of the above
Python supports _____________ types of control structures
1.1
2.2
3.3
4.4
Ram wants to create a program to check whether an year is leap year or not. For this he should have a good understanding of __________
1.Conditional Statement
2.. for loop
3.while loop
4.All the above
Ravi wants to display “Helloâ€, if the condition is True, otherwise, “Pass†if the condition is False. Which of the following help to implement the same?
1.if statement
2.if .. else statement
3.if .. elif statement
4. for loop
The order of execution of the statements in a program is known as ___
1.flow of control
2.central flow
3.selection
4.iteration
What is the purpose of ‘else’ statement in if-elif ladder?
1.else statement in if-elif will execute, if none of the condition is True
2.else statement in if-elif will execute, if all the condition is True.
3.else statement in if-elif will execute, if the condition just above else statement is True
4.None of the above
Which of the following are control structure in python?
1.Selection
2.Iteration
3.Both of the above
4.Sequential
Which of the following is not a keyword in Python?
1.True
2.False
3.if
4.For
Which of the following is variant of conditional statement in Python?
1.simple if without else
2. if .. else
3. if .. elif
4.All the above
Which of the following statement is not assigning a numerical value 8 to variable X, if original value of X is 0? ?
1.X = 8
2.X + = 8
3.X *= 8
4.None of the above
Write the output of the following : x = 10 if x > 7: print("Hello") print("Bye")
1.Bye
2.Hello
3.Bye Hello
4.Hello Bye
Write the output of the following code : if True: print("Hello") else: print("Bye")
1.Bye
2.Hello
3.Bye Hello
4.Hello Bye
Write the output of the following code : y=2 if 2!=y: print("H") else : print("K")
1.H
2.K
3.Error
4.Nothing will be printed
__ is an empty statement in Python.
1.Jump
2.Fail
3.Empty
4.Pass
_____ statements can be written in if block.
1.2
2.4
3.8
4.any number of