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

Class Xii CS Practical File 2

The document contains 20 programming problems and their solutions in Python. The problems cover a range of concepts in Python including data types, control flow, functions, strings, lists, tuples, dictionaries, files and more. Some examples of problems include checking if a number is prime, finding factors of a number, calculating income tax, Fibonacci series, palindrome checker, sorting algorithms and Armstrong number checker. For each problem, the code for the solution is provided along with sample input/output.

Uploaded by

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

Class Xii CS Practical File 2

The document contains 20 programming problems and their solutions in Python. The problems cover a range of concepts in Python including data types, control flow, functions, strings, lists, tuples, dictionaries, files and more. Some examples of problems include checking if a number is prime, finding factors of a number, calculating income tax, Fibonacci series, palindrome checker, sorting algorithms and Armstrong number checker. For each problem, the code for the solution is provided along with sample input/output.

Uploaded by

Arza Kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 63

PROGRAM 1- Write a program for capitalising string characters

alternatively
INPUT=

OUTPUT=

PROGRAM 2 - Write a program to Reverse the given string


INPUT=

OUTPUT=
PROGRAM 3 - Write a program to enter Username and code,
where the code can’t have the username ,and it should
have at least 5 characters for registration

OUTPUT=i)

ii)

iii)

PROGRAM 4- Multiplication of tuple elements


INPUT=

OUTPUT=

PROGRAM 5 - Write a program to input N no of names


and print them in ascending order.
INPUT=

OUTPUT=

PROGRAM 6-Write a program to print highest and second highest


no. in a tuple
INPUT=

OUTPUT=

PROGRAM 7- Write a program to Search the entered no. in a tuple


INPUT=
OUTPUT=

PROGRAM 8- Write a program to Swap the Key and Value of a


given dictionary
INPUT=

OUTPUT=

PROGRAM 9- Write a program to enter the no. of employees then


enter their Id, Name and Salary in a dictionary({id: name,
salary}). If the salary is less than 50,000, give a bonus of 15%, if it
is more than or equal to 30,000, give a bonus of 10% and if it is
less than 30,000 give a bonus of 8%. Then print the total income
of employees.
INPUT=

OUTPUT=

PROGRAM 10- Write a program to enter a string and print how


time it appears using dictionary
INPUT=
OUTPUT=

PROGRAM 11- Write a program to enter a list and multiply the


component of the list by 2 if it is even and multiply it by 3 if it is
odd.
INPUT=

OUTPUT=

PROGRAM 12-Write a program to enter a list and divide the


component of the list by 7 if it is divisible by 7 else multiply it by 3

INPUT=
OUTPUT=

PROGRAM 13-Write a program to enter a list and divide the


component of the list by 10 if it is divisible by 10.
INPUT=

OUTPUT=

PROGRAM 14- TO CHECK IF A NUMBER IS PALINDROME


OR NOT
def palindrome(n):
global rev
rev=0
global n2
n2=n
while(n>0):
d=n%10
rev=rev*10+d
n=n//10
n=int(input("Enter a number to check if it is Palindrome number or
not"))
palindrome(n)
if(rev==n2):
print("Palindrome number")
else:
print("Not a Palindrome number")

PROGRAM 15- TO FIND THE SUM OF SQUARES OF FIRST N


NATURAL NUMBERS
import math
s=0
n=int(input("Enter how many natural numbers are to be
squared"))
for i in range(1,n+1):
s=s+math.pow(i,2)
print("Required sum is",s)

PROGRAM 16 -TO PRINT PRIME NUMBERS WITHIN A


GIVEN RANGE
def prime(s,e):
for i in range(s,e+1):
if(i==1 or i==2):
continue
else:
flag=0
for j in range(2,i):
if(i%j==0):
flag=1
if(flag==0):
print(i)
start=int(input("Enter the starting of the range"))
end=int(input("Enter the ending of the range"))
prime(start,end)

PROGRAM 17 -TO REMOVE ALL THE VOWELS FROM A STRING

def removevowel(str1):
str2=str1
for i in str1:
if i in "AEIOUaeiou":
str2=str2.replace(i," ")
print("The string after removal of all vowels is:",str2)
str1=input("Enter string")
removevowel(str1)

PROGRAM 18 - BINARY SEARCH


def binarysearch(list,low,high,value):
if(high<low):
return None
else:
midval=low+((high-low)//2)
if list[midval]>value:
return binarysearch(list,low,midval-1,value)
elif list[midval]<value:
return binarysearch(list,midval+1,high,value)
else:
return midval
list=[2,1,22,37,91,103]
print(binarysearch(list,0,6,91))
print(binarysearch(list,0,2,103))

PROGRAM 19 - LINEAR SEARCH

def search(list,n):
for i in range(len(list)):
if list[i]==n:
return i
return -1
L=[ ]
for i in range(1,11):
a=int(input("enter numbers"))
L.append(a)
N=int(input("enter number to be found"))
result=search(L,N)
if result==-1:
print("not found")
else:
print("element"+str(N)+"is found at position",result+1)

PROGRAM 20 - INSERTION SORT

def insertionsort(arr):
for i in range(1,len(arr)):
value=arr[i]
pos=i
while pos>0 and value<arr[pos-1]:
arr[pos]=arr[pos-1]
pos=pos-1
arr[pos]=value
L=[ ]
for i in range(1,11):
a=int(input("enter numbers"))
L.append(a)
i=1
print("Original List:",L)
insertionsort(L)
print("sorted list:",L)

PROGRAM 21 - BUBBLE SORT

def bubblesort(arr):
n=len(arr)
for i in range(n-1):
for j in range(n-i-1):
if arr[j]>arr[j+1]:
arr[j],arr[j+1]=arr[j+1],arr[j]
n=int(input("enter number of elements"))
L=[]
for i in range (n):
a=int(input("enter numbers"))
L.append(a)
print("original list:",L)
bubblesort(L)
print("sorted list:",L)

PROGRAM 22 - MENU DRIVEN PROGRAMTO PERFORM PYTHON-


MYSQL CONNECTIVITY
OUTPUT
Program 23 Menu Driven Program (text file)
OUTPUT
rogram 24 –
1.WAPP to read a year and check whether the year is a Leap year or not.’’’
# ARZA KAUR S7C
year = 2023
if (year % 400 == 0) and (year % 100 == 0):
print("{0} is a leap year".format(year))
elif (year % 4 ==0) and (year % 100 != 0):
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))

OUTPUT:
2.WAPP to demonstrate all methods applicable on strings .’’’
#ARZA KAUR S7C

STR=input("Enter a string : ")


STR2=input("Enter another string : ")
print("Concatenation: ", STR+STR2)
print("Repetition of first string 3 times : ", STR*3)
print(STR.upper())
print(STR.lower())
print(STR.title())
print(STR.capitalize())
print(len(STR))
print(STR.split())
if STR.isalpha():
print("All characters are alphabets")
if STR.isalnum():
print("Characters are alphabets or digits")
if STR.isdigit():
print("All characters are digits")
if STR.isupper():
print("All letters are in upper case")
if STR.islower():
print("All letters are in lower case")
print(STR2.join(STR))
a=STR.replace(STR[0],'*')
print(a)

OUTPUT:
3.‘WAPP to input annual income of a person and calculate the payable
income’’’
#ARZA KAUR S7C

int(input("Please enter your annual income (in ruppees) : " ))


if (I<=250000):
print("No tax")
elif (I<=500000):
print("Tax = Rs ", (I-250000)/20)
elif (I<=750000):
print("Tax = Rs ", (I-500000)/10 + 12500)
elif (I<=1000000):
print("Tax = Rs ", 3*(I-750000)/20 + 3*12500)
elif (I<=1250000):
print("20 percent tax, Tax = Rs ", (I-1000000)/5 + 6*12500)
elif (I<=1500000):
print("25 percent tax, Tax = Rs ", (I-1250000)/4 + 10*12500)
else:
print("30 percent tax, Tax = Rs ", (3*(I-1500000)/10) + 15*12500)

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter your annual income (in Rs) : 1000000
Tax = Rs 75000
>>>

4.‘‘‘WAPP to input eclectic consumption (present reading –previous reading)


of a house and calculate total electric bill.Note: Bill up to 200 units is ZERO.
’’’
#ARZA KAUR S7C

A=float(input("Enter your present reading " ))


B=float(input("Enter your previous reading "))
EC=A-B

if EC<=200:
BILL=0
elif EC<=400:
BILL=600+ 4.5*(EC-200)
elif EC<=800:
BILL= 1500 + 6.5*(EC-400)
elif EC<=1200:
BILL= 2800 + 7*(EC-800)
else:
BILL=4200+ 7.75*(EC-1200)
print("The total bill = ", BILL)

5.‘‘‘WAPP to input a natural numbers and display first N FIBONACCI numbers.’’’


#ARZA KAUR S7C

def fibonacci_numbers(num):
if num == 0:
return 0
elif num == 1:
return 1
else:

return fibonacci_numbers(num-2)+fibonacci_numbers(num-1)

n=7
for i in range(0, n):
print(fibonacci_numbers(i), end=" ")

RESTART: C:/Users/ShuntyAnand/AppData/Local/Programs/Python/Python36/non.py
0112358
>>>

6.‘‘‘WAPP to input a natural number and display all the FACTORS of that number’’’
#ARZA KAUR S7C

num =int(input("enter a number"))


for i in range(1, num+ 1):
if (num % i == 0):
print(i)
print("The factors of",num,"are:")

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


enter a number6
1
2
3
6
The factors of 6 are:
>>>

7.‘‘‘WAPP to input a natural number and check whether the number is a PRIME or
not.’’’
#ARZA KAUR S7C

N=int(input("Enter a natural number : "))


SUM=0

for i in range(2,N):
if (N%i==0):
SUM+=1
if (SUM==0):
print("The number is prime.")
else:
print("The number is not prime.")

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter a natural number : 2
the number is prime
Enter a natural number : 88
The number is not prime
8.‘‘‘WAPP to input two natural numbers and calculate and display their HCF/GCD.’’’
#ARZA KAUR S7C
A=int(input("Enter the first natural number : "))
B=int(input("Enter the second natural number : "))
for i in range(1,A+1):
if (A%i==0)and (B%i==0):
HCF=i
print("The HCF = ", HCF)

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter the first natural number: 100
Enter the second natural number : 200
The HCF = 100
>>>
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
the first natural number: 15
Enter the second natural number : 16
HCF = 1
>>>

9.‘‘‘WAPP to input two natural numbers and check whether they are CO-PRIME or
not.’’’
#ARZA KAUR S7C

A=int(input("Enter the first natural number : "))


B=int(input("Enter the second natural number : "))
for i in range(1,A+1):
if (A%i==0)and (B%i==0):
HCF=i
if (HCF==1):
print("The numbers are coprime.")
else:
print("The numbers are not coprime. ")

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter a natural number : 2
The number is prime
>>>
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
Enter a natural number : 88
The number is not prime
>>

10.‘‘‘WAPP to input two natural numbers and calculate and display their LCM.’’’
#ARZA KAUR S7C
A=int(input("Enter the first natural number : "))
B=int(input("Enter the second natural number : "))
LCM=0
for i in range(A,(A*B)+1):
if (i%A==0)and (i%B==0):
LCM=i
if (LCM>=A):
break
print("The LCM = ", LCM)

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter the first natural number : 100
Enter the second natural number : 200
The LCM = 200
>>>
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
Enter the first natural number : 4
Enter the second natural number : 5
The LCM = 20
>>>

11.‘‘‘WAPP to input a natural number and check whether the number


is a ARMSTRONG number or not.’’’
#ARZA KAUR S7C

N=input("Enter a natural number : ")


SUM=0
for i in N:
i=int(i)
SUM+=(i**3)
if SUM==int(N):
print("The number is an Armstrong number.")
else:
print("Not an Armstrong number.")

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter a natural number : 371
The number is an Armstrong number.
>>>
Enter a natural number : 451
Not an Armstrong number.
>>>

12.‘‘‘ *
**
***
* * * *.’’’
#ARZA KAUR S7C
N=int(input("Enter a natural number : "))
for i in range(1,N+1):
print(“*’*i)
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
Enter a natural number : 4
*
**
***
****
>>>

13.‘‘‘ 1
12
123
1234
.’’’
#ARZA KAUR S7C

N=int(input("Enter a natural number : "))


for i in range(1,N+1):
for j in range(1,i+1):
print(j,end="")
print("")

RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py


Enter a natural number : 4
1
12
123
1234
>>>

14.‘‘‘ *
***
*****
* * * * * * *.’’’
#ARZA KAUR S7C

N=int(input("Enter a natural number : "))


for i in range(1,N+1):
print(" "*(N-i)+"*"*((2*i)-1))
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
Enter a natural number : 4
*
***
*****
********
>>>

#ARZA KAUR S7C


15.'''Define a function is Perfect(N) to check whether N is a perfect or not. If
perfect, the function
should return 1 otherwise 0. Using the defined function, write a program to
display all perfect
numbers between 1 and 1000'''
#ARZA KAUR S7C

def ISPERFECT(N):
SUM=0
for i in range(1,(N//2)+1):
if N%i==0:
SUM+=i
if SUM==N:
return True
else:
return False

for i in range(1,1001):
if ISPERFECT(i):
print(i)
RESTART: C:/Users/Shunty Anand/AppData/Local/Programs/Python/Python36/non.py
6
28
496

16.Define functions Pow(X,N) and Factorial(N) to calculate and return X^N


and N! respectively.
Using the defined function, write programs to calculate and display the sum of
following series
S1 = 1 + x^1 + X^2 + x^3 +... + x^n
S2 = 1 - x^1 + X^2 - x^3 +... +or- x^n
S3 = x^1/1 + X^2/2 - x^3/3 +... +or- x^n
S4 = x + X^2/2! - x^3/3! +... +or- x^n
'''
#ARZA KAUR S7C

def POW(X,N):
return X**N

def FACTORIAL(N):
P=1
for i in range(1,N+1):
P*=i
return P
n=int(input("n = "))
x=float(input('x= '))
S1,S2,S3,S4=1,1,x,x
for i in range(1,n+1):
S1+=POW(x,i)
S2+=(POW(x,i)*POW(-1,i))

for i in range(2,n+1):
S3+=(POW(x,i)/i * POW(-1,i))
S4+=(POW(x,i)/FACTORIAL(i) * POW(-1,i))

print('The sum of series 1 + x^1 + X^2 + x^3 +... + x^n = ', S1)

print('The sum of series 1 - x^1 + X^2 - x^3 +... +or- x^n = ', S2)
print('The sum of series x^1/1 + X^2/2 - x^3/3 +... +or- x^n = ', S3)
print('The sum of series x^1/1 + X^2/2 - x^3/3 +... +or- x^n =', S4)

RESTART: C:/Users/Shunty
Anand/AppData/Local/Programs/Python/Python36/non.py

N=4
X =2
'The sum of series 1 + x^1 + X^2 + x^3 +... + x^n = 31.0
'The sum of series 1 - x^1 + X^2 - x^3 +... +or- x^n= 11.0
'The sum of series x^1/1 + X^2/2 - x^3/3 +... +or- x^n =
5.3333333334
'The sum of series x^1/1 + X^2/2 - x^3/3 +... +or- x^n =
3.3333333333335
17.Define a recursive function Factorial(N) to calculate and return
factorial of N. Write a program
to display factorial of the first 5 natural numbers.
'''
#ARZA KAUR S7C

def FACTORIAL(N):
P=1
for i in range(1,N+1):
P*=i
return P
print(FACTORIAL(5))

RESTART: C:/Users/Shunty
Anand/AppData/Local/Programs/Python/Python36/non.py

===== RESTART: C:\Users\lenovo\OneDrive\Desktop\py practice\


prac rep2.py====120

18.Write a menu based program to perform the following task on a Python List
NUMBERS.
A sample List NUMBERS = [12, 33, 13, 54, 34, 57]
The tasks are:
i) Add a new number in the List NUMBERS, entered by the user
ii) Display all numbers stored in the List NUMBERS
iii) Sort the List NUMBERS in descending order using bubble sort technique
(define a function).
'''
#ARZA KAUR S7C

def SORT(L):
for i in range(len(L)-1):
for j in range(len(L)-i-1):
if L[j]<L[j+1]:
temp=L[j+1]
L[j+1]=L[j]
L[j]=temp
return L

NUMBERS=list(map(int,input('Please enter all the elements


separated by a space b/w them : ').split()))

print('Press: \n 1 to add a new number \n 2 to display \n 3 to sort in


descending order \n 4 to quit')

while True:
CHOICE=input('Enter your choice : ')

if CHOICE=='1':
X=int(input('Enter the new no. : '))
I=int(input('Enter the index no. where it needs to be inserted : '))
NUMBERS.insert(I,X)
elif CHOICE=='2':
print(NUMBERS)
elif CHOICE=='3':
SORT(NUMBERS)
elif CHOICE=='4':
print('Thank you')
break
else:
print('Invalid choice.')

OUTPUT:

19.Write a menu based program to perform the following task on a Python List
WORDS.
A sample List WORDS = ['LAN', 'MAN', 'WAN', 'VoIP', 'HTTPS']
The tasks are:
i) Add a new word in the List WORDS, entered by the user
ii) Display all words stored in the List WORDS
iii) Sort the List WORDS alphabetically using bubble sort technique (define a
function)
'''
#ARZA KAUR S7C
def SORT(L):
for i in range(len(L)-1):
for j in range(len(L)-i-1):
if L[j]>L[j+1]:
temp=L[j+1]
L[j+1]=L[j]
L[j]=temp
return L

NUMBERS=input('Please enter all the elements separated by a space


b/w them : ').split()

print('Press: \n 1 to add a new element \n 2 to display \n 3 to sort in


alphabetically \n 4 to quit')

while True:
CHOICE=input('Enter your choice : ')

if CHOICE=='1':
X=int(input('Enter the new no. : '))
I=int(input('Enter the index no. where it needs to be inserted : '))
NUMBERS.insert(I,X)

elif CHOICE=='2':
print(NUMBERS)
elif CHOICE=='3':
SORT(NUMBERS)
elif CHOICE=='4':
print('Thank you')
break
else:
print('Invalid choice.')

OUTPUT:

20.'''Define a function Separate(NUMBERS) to accept a python Tuple


NUMBERS containing natural
numbers as a formal argument and creates and returns two separate Tuples
EVEN and ODD
depending upon whether the numbers in tuple are even or odd as explained
below:
A sample Tuple NUMBERS = (12, 33, 13, 54, 34, 57)
The separated Tuples are:
EVEN = (12, 54, 34)
ODD = (33, 13, 57)
The tasks are:
i) Add a new entry in the Tuple NUMBERS, entered by the user
ii) Display all entries stored in the Tuple NUMBERS
iii) Separate the Tuple NUMBERS using the defined function and display the
two newly
created Tuple EVEN and ODD
'''
#ARZA KAUR S7C

NUMBERS=tuple(map(int,input('Enter all the numbers separated by


space b/w them : ').split()))
EVEN,ODD=[],[]

def SEPARATE(NUMBERS):
for ele in NUMBERS:
if ele%2==0:
EVEN.append(ele)
else:
ODD.append(ele)
return EVEN,ODD

NEW=int(input('Enter the element to be added: ')) #(i)


NUMBERS+=(NEW,)

print(NUMBERS) #(ii)

EVEN,ODD=SEPARATE(NUMBERS) #(iii)
print('EVEN NUMBERS:', tuple(EVEN))
print('ODD NUMBERS: ', tuple(ODD))
OUTPUT:

TERM 1 PROGRAMS
TASK-1-WAPP to display the nature of roots of a Quadratic Equation.
TASK-2-WAPP to read 3 sides (or angles) of a triangle and display whether it’s a Valid Triangle.

TASK-3-WAPP to input a natural number and display the MULTIPLICATION TABLE of that number.

TASK-4-WAPP to input a natural number N and display first N FIBONACCI numbers.


TASK-5-WAPP to input a natural number and display the SUM OF all its proper FACTORS.

TASK-6-WAPP to input two natural numbers and check whether those numbers are AMICABLE or
not.
TASK-7-WAPP to input two natural numbers and calculate and display their HCF/GCD

TASK-8- Write Python programs to input a floating number x and a natural number n and calculate
and display the sum of the cosine series'

TASK-9- Write Python programs to input a floating number x and a natural number n and calculate
and display the sum of the sine series
TASK-10-'''Write Python programs to input a natural number N (if N=4) and display the following
PATTERN:

**

***

****

TASK-11-Write Python programs to input a natural number N (if N=4) and display the following
PATTERN:

12

123

1234

TASK-12-'''Write Python programs to input a natural number N (if N=4) and display the following
PATTERN:

***

*****

******
TASK-13-'''Write Python programs to input a natural number N (if N=4) and display the following
PATTERNS

121

12321

1234321'''

TASK-14- WAPP to input a natural number N and calculate & display the FACTORIAL of N.

TASK-15- WAPP to input a natural numbers and check whether the number is PALINDROMIC or not.
FUNCTION BASED PROGRAMS
TASK-1-Define a function Pattern(N) to display the following pattern when N=4:

TASK-2- Define a function isPerfect(N) to check whether N is a perfect or not. If perfect, the function
should return 1 otherwise 0. Using the defined function, write a program to display all perfect
numbers between 1 and 1000.

TASK-3- Define a function isArmstrong(N) to check whether N is a Armstrong or not. If Armstrong,


the function should return 1 otherwise 0. Using the defined function, write a program to display all
Armstrong numbers between 1 and 1000.
TASK-4-Define a function isPalindrome(N) to check whether N is a Palindromic number or not.Using
the defined function, write a program to display all Palindromic numbers between 1 and 1000.

TASK-5-Define a function isPrime(N) to check whether N is a prime or not. If prime, the function
shouldReturn 1 otherwise 0. Using the defined function, write a program to display all prime

numbers between 1 and 100.


TASK-6-Define a function HCF(A,B) to calculate and return the HCF/GCD of the numbers A and B.
Using the defined function, write a program to check whether two user inputted M and N are co-
prime or not.

TASK-7-Define a function SumOfFactors(N) to calculate and return sum of all proper factors of N
(allfactors including 1 and excluding the number N itself). Using the defined function, write a
program to check whether a number M is perfect or not.
TASK-8- Define a function SumOfFactors(N) to calculate and return sum of all proper factors of N (all
factors including 1 and excluding the number N itself). Using the defined function, write a program
to check whether 2 numbers A and B are amicable or not.

TASK-9- Define a recursive function Factorial(N) to calculate and return factorial of N. Write a
program to display factorial of the first 5 natural numbers.
TASK-10-.Define a recursive function Fibonacci(N) to calculate and return Nth member of the
Fibonacci number series. Write a program to display the first 20 Fibonacci numbers.

STRING/TUPLE/LIST/DICTIONARY BASED
PROGRAMS
TASK-11-WAPP to read a name and display the initials separated by periods.
TASK-12-WAPP to read a name and display the initials of all words except last name and the full last
name separated by periods.

TASK-13-WAPP to read a string and count number of uppercase characters, lowercase characters
and special characters.

TASK-14- WAPP to read a sentence and display the same by reversing characters of all words without
changing the sequence of the words.

TASK-15- WAPP to read a sentence and check whether that sentence contains a word entered by the
user (with or without case sensitivity)
TASK-16- WAPP to input an amount of money and display MINIMUM CURRENCY NOTES (out of
2000/500/200/100/50/20/10/5/2/1) required to have that money.
TASK-17- WAPP to process menu based following operations on a Python LIST having
Create/Append/Display/Search/Modify/Delete.

TASK-18-WAPP to process STACK (LIFO) operations on a Python LIST of numbers [TOP is at the end of
the main LIST)
TASK-19- WAPP to process QUEUE (FIFO) operations on a Python LIST of names

TASK-20-WAPP to read a Python List having 10 Country names and display only those which are 6 or
more characters long.
TASK-21- WAPP to read a Python LIST-STUDENTS contains some small LISTs storing names and
respective marks of few students. Read a name from the user and allow the user to edit their marks.

TASK-22-WAPP to create a Python LIST-STUDENTS contains 10 small LISTS storing names and
respective marks of few students. Read a name from the user and display the marks of that student

TASK-23-WAPP to create a Python LIST-STUDENTS contains 10 small LISTS storing names and
respective marks of few students. Count and display only the number of students who have passed
(scored >=33) and failed.
TASK-24-WAPP to read a List having 10 names and display only those which ends with consonants.

TASK-25-WAPP to read a LIST of numbers and create 2 separate LISTS PRIME and COMPOSITE

TASK-26- WAPP to read a List having 10 names and display only those which ends with consonants.
TASK-27-WAPP to add user entered elements to a tuple and finally display it

TASK-28-WAPP to show that tuples are immutable data types.

TASK-29-WAPP to add user entered element to tuple of numbers, sort the tuple, or display it using a
menu.
TASK-30-WAPP to show names of people over 25 in given tuple of tuples AGES.

TASK-31- WAPP to store a menu in the form of a dictionary with product name as key and price as
value

TASK-32- WAPP to show names of people earning 10000 Rs or more a month from dictionary
containing names as keys and salaries in Rs as values.
Task-33-WAPP to accept employee id from user and store employee name and employee salary in a
dictionary of the format ID: (Name, Salary)

TASK-34-WAPP to create a frequency table of words in a sentence given by user using dictionary
TASK-35- WAPP to see if employee salary is less than 25000 in dictionary of format ID:(Name,Salary)
and increment salary by 1000 if it is. Also display names of those with unchanged salary.

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