0 0
Read Time:59 Second
Q.1	Find if a word is a keyword ?

import keyword
print(keyword.iskeyword("for"))


Q.2	Print all keywords in python.

import keyword
print(keyword.kwlist)
 
Q.3	How many keywords in python ?

Python keywords
•	Class 11th/12th students can learn these keywords [ Approx. 22 ]
•	and , as , break , continue , def , del , elif, else , false , for , if ,    import , in , is , none, not , pass , return , true , while , with , or
•	There are 33 keywords in Python 3.7
•	There are 35  keywords in Python 3.8
•	( Which will increase over time )


Q.4  PREDICT THE OUTPUT


total = 0
def sum( arg1, arg2 ):
      total = arg1 + arg2
      print("Total :", total)
      return total
x = sum( 10, 20 )
print("Total :", total)

	
Total : 0

Q.5 What will the following function return?


def addEm(x, y, z):
    print (x + y + z)
addEm(4,5,6)
	
It is a void function. 

So, it will return None.

If we pass values of x,y, and z in function. It will give an output that is x + y + z.


Q.6 What will be the output of following programs?


num = 1
def myfunc ():
    return num
print(num)
print(myfunc())
print(num)
	

1
1
1

Happy
Happy
%
Sad
Sad
%
Excited
Excited
%
Sleepy
Sleepy
%
Angry
Angry
%
Surprise
Surprise
%
See also  Reading and Writing CSV Files in Python