Python Flashcards

1
Q

The valid combination of both operands and operators make an ………….. which returns a computed result.

A

Expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The …………….. operator is used to concatenate or join two or more strings.

A

’+’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The statements that keep on repeating themselves as long as a given condition is true are called the ………………… statements.

A

conditional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In programming languages, the ……………. statements cause the program control to transfer to a specific location depending on the outcome of the conditional expression.

A

Iterative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In Python, the conditional statement is terminated with a ………………. symbol

A

Colon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Unary operators can be used on more than three operands. True or False?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

An iterative statement is based on 3 values. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Every loop works with the help of a variable known as the control variable. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The iterative statements enable the execution of a set of statements to repeat till the condition is true. True or False?

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The while loop is used when you are not sure about how many times a loop body will be executed. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The ‘if-else-elif’ statement is used when you need to evaluate only one condition. True or False?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If you want to convert a decimal to a binary number, and calculate the reminder in each step. Which operator will you use for this task?

A

Module Operator (%)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You are a sales manager. You want to determine whether you made a profit or loss based on the revenue figure. What is a appropriate conditional construct that you can use to solve the problem

A

if-else condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

An iterative statement is also known as ………………. statement.

A

Looping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The ………………….. loop is used when you are sure about how many times a loop body will be executed

A

For

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

If the condition in a loop is false in the first step itself, you get…………………….. .

A

No output

17
Q

The …………………….. operator checks whether a given value lies within a given set of values.

A

in

18
Q

The …………………….. loop can be applied to a program where the number of iterations is not known beforehand

A

While

19
Q

Name a loop that runs endlessly

A

infinite

20
Q

Name the two types of iterative statements

A

For loop and while loop

21
Q

Name the two membership operators in python

A

in and not in

22
Q

Which function is used to check the range in a loop?

A

Range () Function