You are on page 1of 2

Worksheet 1

1 What is the difference between a Keyword and an identifier?


2 What are literals in Python? How many types of literals are allowed in Python ?
3 What is non literal in Python?
4 What are the data types? What are python's built-in core data types?
5 Which data type of python handle numbers ?
6 Why is Boolean considered as subtype of integers question mark
7 What is the role of comments and indentation in a program?
8 What is identifier in python? Give examples.
9 Write a program to input and print a name .
10 Explain various features of print() function.
11 What is the use of type() function in python.
12 Write a program in python to illustrate use of input() and int() functions.
13 Write a program to input a number and print its square
14 Explain the concept of Expression with the help of example.
15 Write precedence of operators.
16 Explain Type conversion in python.
Worksheet -2
Q1 What are tokens in python? How many type of tokens are allowed in python? Exemplify
your answer.
Q2 What are literals in python? How many type of literals are allowed in python?
Q3 Out of the following , find those identifiers , which cannot be used for naming variable
or functions in a python program

Price*Qty , class , For , do,


4thCol, totally , Row31 , _Amount
Q4 What are operators? What is their functions? Give examples of some unary and binary
operators.
Q5 What are immutable and mutable types? List Immutable and mutable types of Python.
Q6 What is the difference between implicit type conversion and explicit type conversion?
Q7 Consider below given expressions. What will be final result and final data type?

a. a,b=3,6

c=b/a

b. a,b=3,6
c=b / /a

c. a,b=3,6.0
c=b % a

Q8 What will be the output of following expression?


( 5<10) and (10<5) or (3<18) and not 8 <18
Q9 Write a Python program that calculates and prints the number of seconds in a year.
Q10 How many ways are there in Python to represent and integer literal?

You might also like