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

Xi Practical List

This document contains 15 questions related to Python programming. The questions cover a range of topics including Armstrong numbers, net pay calculation, prime numbers, string manipulation, simple interest calculation, area calculation, number operations, Fibonacci series, and dictionary operations. The questions provide examples of the expected output and/or hints for solving each problem.

Uploaded by

Abhinav Azad
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)
25 views5 pages

Xi Practical List

This document contains 15 questions related to Python programming. The questions cover a range of topics including Armstrong numbers, net pay calculation, prime numbers, string manipulation, simple interest calculation, area calculation, number operations, Fibonacci series, and dictionary operations. The questions provide examples of the expected output and/or hints for solving each problem.

Uploaded by

Abhinav Azad
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
You are on page 1/ 5

List of Practical

XI-Comp. Sc.(Python)
Session-2015-16

Q1. Write a program to check whether given number is


Armstrong or not ?
[Hint-153 is an Armstrong number 153=13+53+33
Q2.Write a Program to find Net Pay with HRA and
DA?
Where, HRA=30% of basic pay, DA=119% of
basic pay. Enter Payband and Grade Pay. Basic
Pay is total of Payband and GradePay.
Q3. Write a Program to find Prime Numbers up to
given number.[Hint- prime no.upto 17 i.e.2,3,5,7,11]
Q4. Write a program for finding sum of digits of the
given number. For example, Enter the number:12345
The Sum of digits of 12345 is 15

Q5. Write a program to find Palindrome of a number.


For example, 12321 is a Palindrome
Q6.Write a program to check whether username or
password are correct or not.
For example, D={'A':123,'B':456,'C':000}
Where D contains username and passwords.
enter username :A
enter password:123
username and password is correct

Q7. Write a program to find number of words in a


string.
For example, Enter string My Name is Nitin
Number of words in given string is 4

Q8 . Write the following String methods using a


program
1.)To count number of characters in string.len(string).
For example, string:ABRDEF length=6
2.)To check first character is letter or number.
String.isalphadigit()
For example, string=man, First character is letter.
3.) To change lower case to upper case.
String.upper(), For example,string=manish
Newstring=MANISH
4.) To change one character into another character.
For example,string=mess, Newstring=mass You have to
take the position of the character you want to change
and the desired character.
Q9.Write a program for calculating Simple Interest.
For example, Enter value of Principal Amount:1000
Enter number of years:2, Rate of Interest=20
Simple Interest is:=400

Q10. Write a program for calculating Area of :


1. square
2. rectangle
3. triangle
for example, This program offers you to calculate......
1.Area of Square
2.Area of Rectangle
3. Area of Triangle
Enter your choice:

Q11. Write a program to find sum of natural number


upto a given number.
For example, Enter a number::89
Sum of natural numbers upto 89 is 4005
Q12.Write a program for finding reverse of a number.
For example, integer:12345
Reverse of 12345 is 54321

Q13. Write a program for counting uppercase and


lowercase letters in a string.
For example, Enter a string: My name is Nitin
Number of Uppercase letters= 2
Number of Lowercase letters= 11

Q14. Write a program for Fibonacci Series.


For example, First 13 Fibonacci members are:
(0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)

Q15. Write a program for creating Dictionary with


Keys and Value as month and number of days in
month respectively.
a). Program of dictionary have keys as month and value
as no of days.
For example, enter your month : January
no. of days : 31
enter your month : March
no. of days : 31

b). List all of the keys in alphabetically order.


c). Print out all of the months with 31 days.
for example Month having 31 days are : October ,
January , March , August , May , December , July ,
d). Print out (key-value)pairs sorted by the number of
days in each month.
For example,['(April - 30)', '(June - 30)', '(November - 30)',
'(September - 30)', '(August - 31)', '(December - 31)',
'(January - 31)', '(July - 31)', '(March - 31)', '(May - 31)',
'(October - 31)']

You might also like