Keywords
functions
Conditional statements
Loops
Strings
100

Can we write the keywords in capital letters?

No

100

What function do you use to display output?

print()

100

What is the keyword you use to check for an alternate condition in case the 'if' condition fails?

elif

100

What are the two loops we use in python?

while and for

100

Keyword used to represent a String

str

200

What is the keyword used for decimal values in python?

float

200

What is the function used to take input from the user?

input()

200

What is condition you check for a number n to be even?

n%2==0

200

What does the code do?
n = 6
c=0
while c<=n:
   print(c)
   c+=1

0 1 2 3 4 5

200

s = "Hello World!"
print(s[1:5])

ello

300

What would be the data type of the variable that holds the keyword True

Boolean

300

What function do you use to check the data type of the variable?

type()

300

if False and (10 / 1 > 2) or True :
    print("A")
else:
   print("B")



A

300

What are the 3 factors applied on loop variable?

Initialization, condition and updation

300

s = "Happy Halloween"
What should I type to get the word "Halloween" printed on output screen

print(s[6:]) or print(s[6:15])

400

False is not True evaluates to?

True

400

What is the default data type of the value that input() takes?

String

400

a, b, c = 5, 10, 15
if a > 0:
    if b < 5:
        print("First")
    elif c == 15:
        print("Second")
    else:
        print("Third")
else:
    print("Fourth")


Second

400

i=1
while i<=5:
   print(5//i)
   i+=1

5 2 1 1 1

400

x = "abc"
y = "def"
print(x*2**1 + y)

abcabcdef

500

What is the keyword used for conditional statements other than if-else?

match and case

500

What is the output?
x = 82
y = 26
print("x+y")

x+y

500

What will you see on the output screen?
x = 5
y = 10
if not (x > 2 and y < 5) or y == 10:
print("Passed")
else:
    print("Failed")


Syntax Error

500

x = 3
y = 0
while x < 15:
    x = x * 2
    y = y + x
print(x,y)


24 42

500

What does s[::-1] do to the string s?

Reverses the string

M
e
n
u