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

Prac File

The document contains a list of 25 questions related to Python programming. The questions cover basic Python concepts like variables, data types, operators, conditional statements, loops, functions, classes and modules. The student is required to write code snippets to solve each problem and output the results.

Uploaded by

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

Prac File

The document contains a list of 25 questions related to Python programming. The questions cover basic Python concepts like variables, data types, operators, conditional statements, loops, functions, classes and modules. The student is required to write code snippets to solve each problem and output the results.

Uploaded by

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

MBS INTERNATIONAL SCHOOL

SECTOR-11,DWARKA NEW DELHI-110075

ACADEMIC YEAR : 2023-24

NAME:

CLASS:

SUBJECT: COMPUTER SCIENCE


MBS INTERNATIONAL SCHOOL

SECTOR-11,DWARKA NEW DELHI-110075

INDEX

S.NO PROGRAMS SIGNATURE


Write a simple python
1. program to print the string"
Python Programming".
Write a simple python
2. program to assign same value
to multiple variables print the
values with the variable
names.
Write a simple python
3. program using single line
comment and multiline
comment.
Write a simple python
4. program to get the input from
the user and use int() or
float() function with the read
value to change the type.
Write a simple python
5. program to obtain three
numbers and print their sum.
Write a python program to
6. print the area of a circle of
radius 3.75 meters.
Write a simple python
7. program to take length and
breadth of a rectangle and
calculate the area.
WAP to obtain temperatures
8. of 07 days and then display
average temperature of the
week.
Write a program to calculate
9.
simple interest.
WAP to find if a no is -ve or
10. +ve or 0.
WAP to find no is even and
11. odd.
WAP to find elder person in
12. 2 people.
WAP to find given year is
13. leap year or not.
WAP to print if a person is
14. eligible to vote or not.
Write a program to find
15. largest among three integers.
Write a program that accepts
16. weight in Kg and height in
meters and calculate the
BMI.
Write a program that reads
17. the number n and calculate
n2, n3 and n4 using power
function.
Write a program to obtain x,
18. y, z from the user and
calculate 4x4+3y3+9z+6.
Write a program to input
19. percentage marks of a
student and find the grade as
per following criterion:
Marks Grode Marks Grade
>=90 A 75-90 B 60-75 C
Below 60 D
Write a program to display a
20. menu for calculating area of
circle or perimeter or the
circle.
Write a program that reads
21. two numbers and an
arithmetic operator and
displays the computed result.
Write a program to print
22. whether a given character is
an uppercase or a lowercase
character or an digit or any
other character.
Write a program to print sum
23. of natural numbers between 1
to 7. Print the sum
progressively i.e. after adding
each natural number, print
sum so far.
Write a program to calculate
24. the factorial of a number.
Program that reads a line and
25. print its statistics like:
Number of uppercase letters:
Number of lowercase letters:
Number of alphabets:
Number of digits:
Write a program that reads a
26. line and a substring and
displays the number of
occurrences of the given
substring in the line.
Write a program that takes a
27. string with multiple words
and then capitalizes the first
letter of each word and forms
a new string out of it.
Write a program that reads a
28. string and checks whether it
is a palindrome string or not.
Write a program that reads a
29. string and then prints a string
that capitalizes every other
letter in the string.
WAP to find the sum of all
30. the elements in a list .
WAP to search an element in
31. a list .
WAP to find the minimum
32. and maximum number in a
list entered by a user.
. WAP that take a list as an
33. argument, adds 5 in all the
odd values and 10 in all the
even values of a list and
displays the list.
WAP to display unique and
34. duplicate items of a given list
in two different lists.
WAP to find and display the
35. sum of all the value which
are ending with 3 from a list.
WAP to shift the negative
36. numbers to the right and the
positive numbers to the left
so that the resultant looks
like Original=[-12,11,-13,-
5,6,-7,5,-3,-6] Output should
be =[11,6,5,-6,-3,-7,-5,-13,-
12]
WAP to read a list of n
37. integers (positive as well as
negative). Create two lists,
one having all positive and
another having all negative
integers from the given list.
Print all three lists
.WAP to input any two tuples
38. and swap their values.
WAP to input’n’ names and
39. phone numbers to store it in a
dictionary and print the
phone number of a particular
name.
WAP to input ‘n’ employees
40. and their salary details like
basic salary,hra,ta. Calculate
total salary of each
employee.
Write a program to create a
41. phone dictionary for the
students of class XI and print
their Index values.
Write a program to create a
42. dictionary whose keys are
months and whose values are
number of days in the
corresponding months. Then
ask user to enter a month
name and use this dictionary
to tell how many days are in
the month.
Write a Python program to
43. input names of ‘n’ countries
and their capital and
currency, store it in a
dictionary and display in
tabular form. Also search and
display for a particular
country.
.Write a program to input
44. total number of sections and
stream name in 11th class
and display all information
on the output screen.
WAP to generate random
45. number between 0 and 9.
QUESTION 1: Write a Simple Python Program to print the string “Python Programming”.

INPUT:

OUTPUT:

QUESTION 2: Write a Simple Python Program to assign same value to Multiple.

INPUT:

OUTPUT:

QUESTION 3: Write A Simple Python Program using Single Line Comment And Multiline
Comment.

INPUT:

OUTPUT:
QUESTION 4: Write a simple Python Program to get the input from the user and use int()
or float() function with the read value to change the type.

INPUT:

OUTPUT:

QUESTION 5: Write a simple python program to obtain three numbers and print their sum.

INPUT:

OUTPUT:

QUESTION 6: Write a Python Program to print area of circle of radius 3.75 metres.

INPUT:

OUTPUT:
QUESTION 7: Write a simple Python Program to take length and breadth of a rectangle
and calculate the area.

INPUT:

OUTPUT:

QUESTION 8: WAP To Obtain Temperature of 7 days and then display average


temperature of the week.

INPUT:

OUTPUT:
QUESTION 9: Write a Program To Calculate Simple Intrest.

INPUT:

OUTPUT:

QUESTION 10: Write a program to find if a number is +ve, -ve, or zero.

INPUT:

OUTPUT:

QUESTION 11: Write a program to find Number is Even Or Odd.

INPUT:

OUTPUT:
QUESTION 12: Write a program to find elder person in 2 people.

INPUT:

OUTPUT:

QUESTION 13: Write a program to find given year is leap year or not.

INPUT:

OUTPUT:

QUESTION 14: Write a program to print if a person is eligible to vote or not.

INPUT:

OUTPUT:
QUESTION 15: Write a Program to find largest among three integers.

INPUT:

OUTPUT:

QUESTION 16: Write a program that accepts weight in Kg and height in meters and
calculate the BMI.

INPUT:

OUTPUT:
QUESTION 17: Write a program that reads the number n and calculate n2,n3,n4 using
power function.

INPUT:

OUTPUT:

QUESTION 18: Write a Program to obtain x,y,z from the user and calculate 4x4+3y3+9z+6.

INPUT:

OUTPUT:

QUESTION 19: Write a program to input percentage marks of a student

and find the grade as per following criterion:

Marks Grode

Marks Grade

>=90 A

75-90 B

60-75 C

Below 60 D
INPUT:

OUTPUT:

QUESTION 20: . Write a program to display a menu for calculating area of circle or
perimeter or the circle.

INPUT:

OUTPUT:
QUESTION 21: Write a program that reads two numbers and an arithmetic operator and
displays the computed result.

INPUT:

OUTPUT:

QUESTION 22: Write a program to print whether a given character is an uppercase or a


lowercase character or an digit or any other character.

INPUT:

OUTPUT:
QUESTION 23: Write a program to print sum of natural numbers between 1 to 7. Print the
sum progressively i.e. after adding each natural number, print sum so far.

INPUT:

OUTPUT:

QUESTION 24: Write a program to calculate the factorial of a number.

INPUT:

OUTPUT:

QUESTION 25: Program that reads a line and print its statistics like:

Number of uppercase letters:

Number of lowercase letters:

Number of alphabets:

Number of digits:
INPUT:

OUTPUT:

QUESTION 26: Write a program that reads a line and substring and displays the number of
occurrences of the given substring in the line.

INPUT:
QUESTION 27: Write a program that takes a string with multiple words and then
capitalizes the first letter of each word and forms a new string out of it.

INPUT:

OUTPUT:

QUESTION 28: Write a program that reads a string and checks whether it is a palindrome
string or not.

INPUT:

OUTPUT:
QUESTION 29: Write a program that reads a string and then prints a string that capitalizes
every other letter in the string.

INPUT:

OUTPUT:

QUESTION 30: Write a program to find the sum of all the elements in a list.

INPUT:

OUTPUT:

QUESTION 31: Write a program to search an element in a list.

INPUT:
OUTPUT:

QUESTION 32: Write a program to find the minimum and maximum number in a list
entered by a user.

INPUT:

OUTPUT:

QUESTION 33: Write a program that take a list as an argument, adds 5 in all the odd values
and 10 in all the even values of a list and displays the list.

INPUT:

OUTPUT:

QUESTION 34: Write a Program to display unique and duplicate items of a given list in two
different lists.

INPUT:
OUTPUT:

QUESTION 35: Write a Program to find and display the sum of all the value which are
ending with 3 from a list.

INPUT:

OUTPUT:

QUESTION 36: . Write a Program to shift the negative numbers to the right and the
positive numbers to the left so that the resultant looks like Original=[-12,11,-13,-5,6,-7,5,-
3,-6] Output should be =[11,6,5,-6,-3,-7,-5,-13,-12]

INPUT:

OUTPUT:
QUESTION 37: Writ a Program to read a list of n integers (positive as well as negative).
Create two lists, one having all positive and another having all negative integers from the
given list. Print all three lists.
INPUT:

OUTPUT:

QUESTION 38: WAP to input any two tuples and swap their values.

INPUT:
OUTPUT:

QUESTION 39: WAP to input’n’ names and phone numbers to store it in a dictionary and
print the phone number of a particular name.

INPUT:

OUTPUT:
QUESTION 40: Write a Program to input ‘n’ employees and their salary details like basic
salary,hra,ca. Calculate total salary of each employee.

INPUT:

OUTPUT:

QUESTION 41: Write a program to create a phone dictionary for the students of class XI
and print their index values.

INPUT:
OUTPUT:

QUESTION 42: Write a Program to create a dictionary whose keys are months and values
are number of days in the corresponding month. Then ask user to enter a month name
and use this dictionary to tell how many days are there in a month.

INPUT:

OUTPUT:

QUESTION 43: Write a Python Program to input names of ‘n’ countries and capital and
currency, store it in a dictionary and display in tabular form. Also search and display for a
particular country.

INPUT:
OUTPUT:

QUESTION 44: Write a Python program to input total number of sections and stream
name in 11th class and display all information on output screen.

INPUT:

OUTPUT:

QUESTION 45: Write a program to generate random number between 0 and 9.

INPUT:
OUTPUT:

OUTPUT:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy