Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Questions Bank - Programing With Python

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

QUESTIONS BANK –

PROGRAMING WITH PYTHON


SET 1

1) who is developer of Python?


2) Where was Python developed?
3) Why name Python?
4) Define assignment statement.
5) List the statements in python.
6) Given the strings x=’alpha’ and y=’beta’ print the concatenated string .
7) List some of the keywords in python.
8) Define Identifiers in Python
9) What is the comment statement in python?
10) Define variables in python.
11) Explain Input and output statements in python.
12) List the data types in python.
13) What are the operators in Python?
14) Solve the mathematical expression 7/3 * 1.2 +3/2.0
15) Define functions in python?
16) Explain the precedence of operators in python.
17) What are the function arguments types used in python?
18) List the types of functions.
19) What is the anonymous function in Python?
20) Define modules in Python.
21) How modules are incorporated in a python program?
22) List some of the built-in modules in python
23) Write a simple program to add two numbers in python.
24) Write a simple program to convert KMPH to MPH in python.
25) Write a simple program in python to convert decimal number into binary, octal and
hexadecimal number system in python.

SET 2

1) Explain various types of operators used in Python


2) Explain Values & types supported in Python
3) What are the different function prototypes? Explain it with suitable example.
4) Explain Interpreter & Interactive mode in Python
5) Write a program to Circulate value of N numbers
6) Explain about various statements in python
SET 3

1) Define Boolean datatype?


2) What are the conditional statements used in python?
3) Define if…else statements in python.
4) Write the syntax for ternary operator in python.
5) Define chained conditions.
6) Write the syntax for if…elif…else conditionals.
7) Define Iteration.
8) What are the different iterative statements?
9) Define range() function and its syntax.
10) Define while loop.
11) Write the syntax for nested for loops and nested while loop statements.
12) What is python break statement?
13) What is python continue statement.
14) Define fruitful functions in python.
15) What are the types of parameters in functions?
16) What are the various parameter passing techniques?
17) Write the scope of the variable.
18) What is recursive function and its limitations?
19) Write the merits of using functions in a program.
20) Write the syntax for composition.
21) Define strings and name some methods.
22) List some of the methods used in List Operations.
23) State the differences between linear search and Binary search.

SET 4

1) Explain in detail about Control flow structures


2) Explain Various String functions used in python
3) Write a Python program to compute the factorial of a given number using recursion
4) Write a Python program using while loop to print first N numbers divisible by 5
5) Explain the concept of Linear & Binary Search with Python program
6) Discuss Function arguments in Python
SET 5
1) Define List?
2) What is cloning of List?
3) What is aliasing?
4) Define tuple.
5) Explain Tuple Assignment with example.
6) What is slicing?
7) Define Dictionary.
8) Give an example for List comprehension.
9) What is mutability?
10) List the functions of tuple data type.
11) List the methods of list data type.
12) Comment on tuple as return type.
13) When a dictionary is used instead of a list?
14) Differentiate between append() and extend() methods?
15) What is the output of print list + tiny list? List =
[‘abcd’,786,2,23,’john’,70.2] ,tinylist=[ 123,’john’]
16) What is the difference between tuples and lists in python?
17) What is the difference between del() and remove() methods of list?
18) How to merge two dictionaries?
19) Define mutable and immutable data type.
20) When is dictionary used instead of a list?

SET 6

1) Explain the following:


a. List Slicing &List Mutability
b. List Accessing Methods &List Comprehension
2) Explain Selection & Insertion sort methods with python program
3) Explain Merge & Quick sort methods with python program
4) Explain Dictionary Operation & Methods
5) Write code snippets in Python to perform the following
a. Accessing Elements of a Tuple
b. Modifying Elements of a Tuple
c. Deleting Elements of a Tuple
SET 7
1) Define File.
2) List the file opening Modes.
3) List the different ways to read a file.
4) What the difference is between append and write mode?
5) What are the attributes of file objects?
6) List the methods in file objects.
7) Differentiate Errors and Exceptions.
8) Illustrate try-except-else
9) Define modules.
10) Define packages.
11) Define pickling.
12) Give the mechanism to handle exceptions.

SET 8

1) What are the two types of files? Explain different file operations
2) How will you create a Package & import it? Explain it with an example program
3) Write a python program to count the number of words in a text file
4) Explain the concept of Exception Handling in Python with suitable program
5) Write Short notes on : 1 Overriding 2. Overloading 3.Abstract Methods 4.Modules
5. Packages 6. Inheritance 7. Accessibility Modifier

You might also like