You are on page 1of 3

DEPARTMENT OF INFORMATION TECHNOLOGY

VR SIDDHARTHA ENGINEERING COLLEGE

14EC4706/4: PYTHON PROGRAMMING

A.Y 2017-18
UNIT-1

1. What are the different building blocks of python programming environment?


2. What could possibly go wrong in python programming?
3. Explain how to converse with python?
4. Write down the difference between word and sentence in python. Explain with a simple
program.
5. a. Explain the following types of errors:
i Semantic errors ii Logical errors iii Syntax Errors
6. Explain how interpreter and compiler work in python shell.
7. Explain each of the following using an example of a human capability: (1) Central
processing unit, (2) Main Memory, (3) Secondary Memory, (4) Input Device, and (5)
Output Device.
8. Explain different steps involved in writing a program in python?

UNIT-2

1. Explain how debugging happens in python programming.


2. Write a python program which prompts the user for a Celsius temperature, convert the
temperature to Fahrenheit and print out the converted temperature.
3. What are the different data types that are supported by python?
4. Explain the order of operations that happens when more than one operator is present in
expression.
5. Write a python program to swap two variables without using third variable.
6. What are the different data types that are supported by python?
7. Explain different string operations used in python programming.
8. write python program to find the factorial of a given number.

UNIT-3

1. Write a python program to print all the prime numbers in an interval.


2. Differentiate conditional and alternative execution in python with example programs.
3. Why functions in python? Explain the difference between fruitful and void functions.
4. Write a python program to make a simple calculator?
5. Define Built In Functions? Explain different built in functions that are available in
python.
6. Explain chained conditionals and nested conditionals in python.
7. Explain the following python functions.
i Fruitful functions ii Void Functions
8. Explain how type conversion function in python works with a simple example.
9. Explain different loop patterns that are available in python.
10. Write a python program to check whether the given string is palindrome or not.
11. Write a python program to find amstrong number in a given interval?
12. Explain traversal through a string with a loop in python.
13. Explain different loop patterns that are available in python.
14. Write a python program to find length of a given string with len() function.
15. Write a python program to find sum of n natural numbers using while statement.
16. Explain maximum and minimum loops in python with an example.

UNIT-4:
1. Write a program to prompt for a file name, and then read through the file and look for
lines.
2. Explain how to let a user choose a file name and to open, read a file and search through a
file using python programming
3. Describe the concept of Extracting data using regular expressions.
4. Illustrate how character matching is done using regular expressions in python
programming.
5. Explain the concept of Combining searching and extracting with example program.
6. What is the proper use of try, except, and open in file python programming.

PART-A

a. How do you fix a Syntax error ?


b. Differentiate operator and operand?
c. Explain the disadvantages of python.
d. How do we share global variables across modules in Python?
e. Is python a case sensitive language?
f. What is the output of print str if str = 'Hello World!'?
g. List down strings special operators.
h. Write a python code to write a file by opening it in mode ‘w’.
i. What is a regular expression?
j. What is the purpose of the “def” keyword in Python?
k. How do you fix a Syntax error ?
l. Explain the disadvantages of python.
m. What is Escape character ?

You might also like