0% found this document useful (0 votes)
34 views

Python Subjective Question Set

The document contains a collection of Python subjective questions organized under different topics like problem solving, data types, operators, strings, lists, tuples, dictionaries, modules, functions and files. The questions are meant to test conceptual understanding of Python programming concepts.

Uploaded by

anilgahlawat1987
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Python Subjective Question Set

The document contains a collection of Python subjective questions organized under different topics like problem solving, data types, operators, strings, lists, tuples, dictionaries, modules, functions and files. The questions are meant to test conceptual understanding of Python programming concepts.

Uploaded by

anilgahlawat1987
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Python Subjective Question Set

Topic: Introduction to Problem Solving


Reference Videos: CS Academy-> Python -> Videos -> Introduction of Python
Questions:
1. What are the steps for problem solving? Explain the steps in detail
2. What is an algorithm? What are the characteristics of a good algorithm?
How are algorithms represented?
3. Write an algorithm to find the square of a number.
4. Write an algorithm to calculate area and perimeter of a rectangle, using
both pseudocode and flowchart.
5. What are conditionals? When they are required in a program?
6. What is decomposition of a problem?
Topic: Familiarization with the basics of Python programming
Reference Videos: CS Academy-> Python -> Videos -> Introduction of Python
Questions:
1. Explain the execution modes of Python.
2. Explain the features of Python.
3. Explain Tokens in Python.
4. What is the significance of comments in Python?
Topic: Knowledge of Data Types & Operators
Reference Videos: CS Academy-> Python -> Videos -> Data Types & Operators
Questions:
1. What are the different data types in Python?
2. What are the different operators in Python?
3. Write a program to enter two integers and perform all arithmetic
operations on them.
4. Which data type will be used to represent the following data values and
why? a) Number of months in a year b) Resident of Delhi or not c)
Mobile number d) Pocket money e) Volume of a sphere f) Perimeter of a
square g) Name of the student h) Address of the student
5. Write a program to swap two numbers i. using a third variable ii. Without
using a third variable
6. Write a program to repeat the string ‘‘GOOD MORNING” n times. Here
‘n’ is an integer entered by the user
7. The formula E = mc2 states that the equivalent energy (E) can be
calculated as the mass (m) multiplied by the speed of light (c = about
3×108 m/s) squared. Write a program that accepts the mass of an object
and determines its energy.
8. Write a program that asks the user to enter their name and age. Print a
message addressed to the user that tells the user the year in which they
will turn 100 years old.
Topic: Expressions, type conversion & input/output
Reference Videos: CS Academy-> Python -> Videos -> Data Types & Operators
CS Academy-> Python -> Videos -> Statements & Flow of Control
Questions:
1. What are expressions? Explain precedence of operators in an expression.
2. Explain Type conversion in Python
3. What are the different types of errors in Python? Explain
4. Explain input and output in Python.
5. Write a program in python to show accepting data as input from the
console and displaying output
Topic: Statements, Conditional Statements, Iterative statements and Flow of
Control
Reference Videos: CS Academy-> Python -> Videos -> Statements & Flow of
Control
Questions:
1. Explain the significance of indentation in Python.
2. What is the difference between else and elif construct of if statement?
3. Differentiate between break and continue statements using examples
4. What is an infinite loop? Give one example.
5. Differentiate and explain sequential flow, conditional and iterative flow
of control
6. Write a program to find out the absolute value of a number n,
7. Write a program to sort 3 numbers
8. Write a program to find out divisibility of a number n by another number
m, where m and n are integers input by the user
9. Write a program to generate the sequence: –5, 10, –15, 20, –25….. upto
n, where n is an integer input by the user
10. Write a program that checks whether an input number is a palindrome
or not.
11.Write a program to print the following patterns

12.Write a program to find the sum of 1+ 1/8 + 1/27......1/n3, where n is the


number input by the user. (Summation of a series)
13.Write a program to calculate the factorial of a given number.
Topic: Strings and Lists
Reference Videos: CS Academy-> Python -> Videos -> Strings and List Part 1
CS Academy-> Python -> Videos -> Strings and List Part 2
Questions:
1. Explain operations on a string in python.
2. Explain indexing in a string in python
3. Give a brief about built in functions on strings in python
4. Explain operations on a list in python.
5. Explain indexing in a list in python
6. Give a brief about built in functions on lists in python
7. Input a string having some digits. Write a program to return the sum of
digits present in this string
8. Write a program to input line(s) of text from the user until enter is
pressed. Count the total number of characters in the text (including
white spaces),total number of alphabets, total number of digits, total
number of special symbols and total number of words in the given text.
(Assume that each word is separated by one space)
9. Write a program that takes a sentence as an input parameter where each
word in the sentence is separated by a space. The function should
replace each blank with a hyphen and then return the modified
sentence.
10. Write a program for finding the maximum, minimum and mean of
numeric values stored in a list
11. Write a program to implement linear search on list of numbers
12. Write a program for counting the frequency of elements in a list
13. Write a program to read a list of elements. Modify this list so that it does
not contain any duplicate elements, i.e., all elements occurring multiple
times in the list should appear only once
Topic: Tuples and Dictionaries
Reference Videos: CS Academy-> Python -> Videos -> Strings and List Part 2
Questions:
1. Explain operations on a tuple in python.
2. Explain indexing in a tuple in python
3. Give a brief about built in functions on tuples in python
4. Write a program for finding the maximum, minimum and mean of
numeric values stored in a tuple
5. Write a program to implement linear search on tuple of numbers
6. Write a program for counting the frequency of elements in a tuple
7. Explain operations on a dictionary in python.
8. Write short notes on creating dictionary and accessing items in a
dictionary in python
9. Give a brief about dictionary methods and built in functions in python
10. Write a program to count the number of times a character appears in a
given string using a dictionary
11. Write a program to create a dictionary with names of employees, their
salary and access them
12. Write a Python program to find the highest 2 values in a dictionary.
13. Write a program to read email IDs of n number of students and store
them in a tuple. Create two new tuples, one to store only the usernames
from the email IDs and second to store domain names from the email
IDs. Print all three tuples at the end of the program. Use the function
split()
14. Write a Python program to create a dictionary from a string. Note: Track
the count of the letters from the string.
Sample string : 'w3resource'
Expected output : {'3': 1, 's': 1, 'r': 2, 'u': 1, 'w': 1, 'c': 1, 'e': 2, 'o': 1}

Topic: Modules
Reference Videos: CS Academy-> Python -> Videos -> Modules and Interfacing
Questions:
1. Explain importing of a module in python
2. Write short notes on math module in python
3. Write short notes on statistics module in python
4. Write short notes on random module in python
Topic: Functions and files
Reference Videos: CS Academy-> Python -> Videos -> Modules and Interfacing
Questions:
1. What are functions and what are its advantages in python?
2. Explain user defined functions.
3. Write a user defined function to add 2 numbers and display their sum.
4. Write a short notes on arguments and parameters in python
5. Differentiate between local scope and global scope of a variable
6. What are the different types of functions in Python?
7. What are the different types of files supported in Python? Explain the
operations, modes and methods of those files.

You might also like