0% found this document useful (0 votes)
28 views5 pages

Model Questions-1

The document contains a comprehensive list of model questions related to programming in Python, covering topics such as variable declaration, keywords, control structures, string handling, loops, data types, and object-oriented programming. It includes programming tasks, explanations of concepts, and examples for various Python functionalities. The questions serve as a guide for learners to understand and practice key Python programming skills.

Uploaded by

benafflick106
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views5 pages

Model Questions-1

The document contains a comprehensive list of model questions related to programming in Python, covering topics such as variable declaration, keywords, control structures, string handling, loops, data types, and object-oriented programming. It includes programming tasks, explanations of concepts, and examples for various Python functionalities. The questions serve as a guide for learners to understand and practice key Python programming skills.

Uploaded by

benafflick106
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CST 362 PROGRAMMING IN PYTHON

Model Questions.

1)List out the rules for declaring a variable in python program.


2)What is keyword? Give examples.
3)What is Floor division in python
4)Write the Syntax for if-elif statements.
5)Draw the flowchart for the following loops
For loop
While loop
6)Develop a python program to find the biggest of three
numbers
7)List out various symbols used in flowchart
8)Write the answers of the following in reference to given
string.
str=”welcome to my blog”
a)print (str[3:18]
b)print(str[2:14:2])
c)print(str[8:-1:1])
9)Strings are immutable, Expalin with one example
10)Explain any five python string handling function with
example.
11)Explain any 3 escape sequences in python with examples.
12)What is logical operators in python.? Show in example.
13)Write any 4 bitwise operators with examples.
14)Differentiate python membership operators and identity
operators.
15)What is the general syntax of range() function.
16)Differentiate break and continue statement with example.
17)What is pass statements in python.
18)Write a nested for loop program to print multiplication table
in Python
19)Write a program to check prime number or not.
20) Write a Python program to reverse a given number
21)Write a python program to find factorial of a number.
22)Write a program to check Armstrong number.
23)Write a program to print Fibonacci sequence up to nth term.
24)Explain any five string handling function with example.
25)Explain any 3 escape sequences in python with examples.

26)Write a Python program to reverse a number and also find


the sum of digits of the number. Prompt the user for input.

27)Illustrate escape sequences with examples.


28)Explain Various decision making statements in python.
29)Explain for loop with else case with an example.
30)What is the purpose of break statement.?
31)Differentiate while loop and while loop with else case with
examples.
32)What is the purpose of continue statement?
33)What is the purpose of pass statement in Python.?
34)Differentiate break and continue statements.
35)Explain different types of loops with examples.
36)Write a python program to construct the following pattern,
using a nested for loop.
*
**
***

37)Write a program to generate fibonacci series first N


numbers.
38)Write a program to find the factorial of a number.
39)Write a program to count the number of vowels.
40)Briefly describe data types in Python.
41)How will you create a dictionary in python.
42)What are the uses of //,**,*= operators in python.
43)What is string in Python? Why is len function used in
string.?
44)What is the Slice operator ? Explain with example.
45)What will be the output of the given code
str1=”hello world”
str2=”welcome me to programming”
print (str1[4])
print(str1*5)
print(str1[6:])
print(str1[5:10])
46) What is list ? Explain with an example.
47) What is tuple in pythons ? Compare tuple and list.
48)What are the built-in tuple functions in Python.
50)What is dictionary ? Explain with example.
51)Explain the concept of scope and lifetime of
variablesin Python programming language, with a
suitable example.

52)Write a Python code to check whether a given year is


a leap year or not [An year is a leap year if it’s
divisible by 4 but not divisible by 100 except for
those divisible by 400].

53)What are the possible errors in a Python program.


Write a Python program to print the value of 22n+n+5
for n provided by the user.

54)Write a Python code to determine whether the given


string is a Palindrome or not using slicing.

55) How can a class be instantiated in Python? Write a


Python program to express the instances as
return values to define a class RECTANGLE with
parameters height, width, corner_x, and corner_y
and member functions to find center, area, and
perimeter of an instance.
56) Give some overview of turtle graphics in Python.
57) Explain any five turtle methods in python.
58) Draw a star using turtle methods.
59) Write program to Filling Radial Patterns with
Random Colors
60) Explain any six image methods in python.
61) Write a program to convert a color image to back
and white
62) Explain Tkinter Graphical User interface in python
63) Differentiate between terminal based and GUI based
programming in Python?
64) Write a program to draw a hexagon using turtle
65) Write a note on the image processing in Python
66) Describe the features of event driven Programming?
67) What is exceptions and how to handle it in python
68) Write a program to program to catch on Divide by
zero exception.Add a finally block too.
69) Differentiate default constructor and parameterized
constructor.
70) Explain the OOP Principle inheritance in python
with example.
71) Write a function that has a class Animal with a
method legs. Crete two sub classes Tiger and
Dog. Now access the method leg explicitly with the
class Dog and implicitly with the class tiger.
72) Explain inheritance in Python. Give examples for
each type of inheritance.
73) Explain the os and os.path modules in Python with
examples. Also, discuss the walk( )and getcwd( )
methods of the os module.
74) What are the important characteristics of CSV file
format.
75) Briefly Explain the role of Numpy in Python.
76) Write a Python program to add two matrices and
also find the transpose of the resultant matrix.
77) How to Reading and Writing CSV Files in Python
78) What are the advantages of Pandas.
https://hemanthrajhemu.github.io/AnswerScript/WP/
CSE6/64_PAP/M1/AS_PAP_M1_P3.html

You might also like