0% found this document useful (0 votes)
4 views12 pages

Python Programming - Problem Statements

The document outlines a series of Python programming tasks divided into 31 questions. Each question includes specific programming operations related to data structures such as lists, strings, tuples, sets, and dictionaries, as well as the implementation of functions and exception handling. The tasks cover creating, accessing, modifying, and handling errors for various data types and user inputs.

Uploaded by

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

Python Programming - Problem Statements

The document outlines a series of Python programming tasks divided into 31 questions. Each question includes specific programming operations related to data structures such as lists, strings, tuples, sets, and dictionaries, as well as the implementation of functions and exception handling. The tasks cover creating, accessing, modifying, and handling errors for various data types and user inputs.

Uploaded by

Aniket
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Question Number (1)

A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements
B) Write a Python program to check whether a given string is a palindrome or not using a function. Use the
concept of a function with parameters and with return value.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.

Question Number (2)


A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String
B) Write a Python program to find the largest of two numbers using a function. Use the concept of a function
with parameters and with return value.
C) Write a Python program that opens a file and reads its contents. The program should print the entire content of
the file on the screen. Implement and demonstrate the core concepts of file handling.

Question Number (3)


A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples

B) Create a Python class Mobile with attributes brand, model, and price. Define a method display () to show mobile
details. Create and display data for three mobiles. Implement the basic concepts of classes and objects.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.
Question Number (4)
A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a Python Create a Python class Mobile with attributes brand, model, and price. Define a method display
() to show mobile details. Create and display data for three mobiles. Implement the basic concepts of classes
and objects.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (5)


A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements

B) Write a Python program to check if a number is positive or negative using a function. Use the concept of a
function without parameters and without return value.
C) Write a Python program that opens a file and reads its contents. The program should print the entire content of
the file on the screen. Implement and demonstrate the core concepts of file handling.

Question Number (6)


A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements

B) Write a Python program to define a class Teacher with attributes name, subject, and experience. Add a method
show_info() to display the teacher’s details. Create and display data for multiple teachers. Implement the basic
concepts of classes and objects.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.
Question Number (7)
A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String
B) Write a program to check whether a number prime or not using a function. Use the concept of a function with
parameters and with return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (8)


A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples
B) Write a Python program to check if a number is positive or negative using a function. Use the concept of a
function without parameters and without return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.

Question Number (9)


A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order

B) Create a Python class Book with attributes title, author, and price. Define method display_details() to print the
details of the book. Create and display information for at least three books. Implement the basic concepts of
classes and objects.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.
Question Number (10)
A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements
B) Write a program to calculate the area of a circle using user define module concept.
C) Write a Python program that opens a file and reads its contents. The program should print the entire content of
the file on the screen. Implement and demonstrate the core concepts of file handling.

Question Number (11)


A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements
B) Create a Python class Mobile with attributes brand, model, and price. Define a method display() to show mobile
details. Create and display data for three mobiles. Implement the basic concepts of classes and objects.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.

Question Number (12)


A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String
B) Write a program to determine whether a person is a child, teenager, adult, or senior citizen based on age using
user define module concept.
C) Write a program that tries to add a number and a string. Handle TypeError properly. Implement the basic
concepts Exception Handling.
Question Number (13)
A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples
B) Write a program to check if a given year is a century year (e.g., 1900, 2000) using a function. Use the concept
of a function without parameters and without return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.

Question Number (14)


A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a program to calculate the area of a triangle using user define module concept.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (15)


A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements

B) Write a program to calculate the area of a triangle using user define module concept.
C) Write a Python program that opens a file and reads its contents. The program should print the entire content of
the file on the screen. Implement and demonstrate the core concepts of file handling.
Question Number (16)
A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements
B) Write a Python program to define a class Teacher with attributes name, subject, and experience. Add a method
show_info() to display the teacher’s details. Create and display data for multiple teachers. Implement the basic
concepts of classes and objects.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.

Question Number (17)


A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String

B) Create a Python class Book with attributes title, author, and price. Define method display_details() to print the
details of the book. Create and display information for at least three books. Implement the basic concepts of
classes and objects..
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (18)


A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples

B) Write a program to find the factorial of a number using user define module concept.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.
Question Number (19)
A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a Python program to find the largest of two numbers using a function. Use the concept of a function with
parameters and with return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (20)


A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements
B) Write a program to check whether the number divisible by 11 using a function. Use the concept of a function
with parameters and without a return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (21)


A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements

B) Create a Python class Mobile with attributes brand, model, and price. Define a method display() to show mobile
details. Create and display data for three mobiles. Implement the basic concepts of classes and objects.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.
Question Number (22)
A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String

B) Write a Python program to define a class Teacher with attributes name, subject, and experience. Add a method
show_info() to display the teacher’s details. Create and display data for multiple teachers. Implement the basic
concepts of classes and objects.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (23)


A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples
B) Write a Python program to check whether a given number is a palindrome or not using a function. Use the
concept of a function without parameters and with return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.

Question Number (24)


A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a Python program to check whether a given string is a palindrome or not using a function. Use the
concept of a function with parameters and with return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.
Question Number (25)
A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements
B) Write a Python program to check if a person is eligible to vote (age ≥ 18) using a function. Use the concept of
a function with parameters and without a return value.
C) Write a Python program that opens a file and reads its contents. The program should print the entire content of
the file on the screen. Implement and demonstrate the core concepts of file handling.

Question Number (26)


A) Write a Python program to perform following operations on List.

* Creating a List
* Accessing Elements
* Index
* Slicing
* Adding and Removing Elements
B) Write a Python program to check if a number is positive or negative using a function. Use the concept of a
function without parameters and without return value.
C) Write a program that asks the user to enter an integer. If the user enters something else (like text), handle the
ValueError exception. Implement the basic concepts Exception Handling.

Question Number (27)


A) Write a Python program to perform following operations on String.

* Creating a String
* Accessing Characters in string
* Slicing
* Index
* Length of String

B) Write a program find the year is leap year or not using a function. Use the concept of a function without
parameters and with return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.
Question Number (28)
A) Write a Python program to perform following operations on Tuple.

* Creating a Tuple
* Accessing Elements
* Index
* Slicing
* Nested Tuples
B) Write a program to check whether a number prime or not using a function. Use the concept of a function with
parameters and with return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.

Question Number (29)


A) Write a Python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a program to check whether a number is even or odd using a function. Use the concept of a function with
parameters and without a return value.
C) Write a Python program that takes two numbers from the user and handles the division by zero exception if the
second number is zero. Implement the basic concepts Exception Handling.

Question Number (30)


A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements

B) Write a program to check whether a number is even or odd using a function. Use the concept of a function with
parameters and without a return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.
Question Number (31)

A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements
B) Write a program to check whether the number divisible by 5 and 11 using a function. Use the concept of a
function with parameters and without a return value.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.

Question Number (32)

A) Write a python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order

B) Create a class Calculator with a method add() that can take: one value, two values and three values and print
the sum and to demonstrate the use of polymorphism.
C) Write a program to open [Link] in append mode and add one new line of text without deleting the existing
content. Implement and demonstrate the core concepts of file handling.

Question Number (33)

A) Write a Python program to perform following operations on Dictionary.

* Creating a Dictionary
* Accessing a Dictionary
* Ordered
* Adding Elements
* Removing Elements
B) Create a class Calculator with a method add() that can take: one value, two values and three values and print
the sum and to demonstrate the use of polymorphism.
C) Write a program that tries to open a file named "[Link]". If the file does not exist, handle the FileNotFoundError
exception. Implement the basic concepts Exception Handling.
Question Number (34)

A) Write a python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a program to check whether the number divisible by 5 and 11 using a function using user define module
concept.
C) Write a program to open [Link] in append mode and add one new line of text without deleting the existing
content. Implement and demonstrate the core concepts of file handling.

Question Number (35)

A) Write a python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order

B) Write a program to check if a given year is a century year (e.g., 1900, 2000) using a function using user define
module concept.
C) Write a Python program to read a file [Link] and count how many lines it has. Implement and demonstrate
the core concepts of file handling.

Question Number (36)

A) Write a python program to perform following operations on Set.

* Creating a Set
* Accessing Elements
* Index
* Slicing
* Order
B) Write a program to determine whether a person is a child, teenager, adult, or senior citizen based on age using
user define module concept.
C) Write a Python program to read a file [Link] and count how many lines it has. Implement and demonstrate
the core concepts of file handling.

You might also like