INDEX
S.No
■Ù
sign
Ra ndom
()
1.
Write a program to s imulate a dice ro ll.
2.
Write a program to s imulate a lottery d raw.
Loop
1.
Write a program to display the pattern
**
***
*** *
2.
calculates the sum o f all even numbers up to
a user
-
pro vided number.
Neste d Loop
1.
display a multip licatio n table.
2.
List
Write a program to print the pyr amid pattern .
1.
Writega program that co llects multiple strings
Strin
from t he user using a loop, sto res them in a
lis t, and then displays the lis t in reverse ord er.
1.
2.
Write a program that co unts thenumber of
vowels in a user
-
Write a program where the user inputs
pro vided into
numbers s tring
a lis
. t
using a lo o p,and the
pro gram calcul ates the averag e of those
2.
numbers.
Write a program that
reve rses a us er
-
Tuple
pro vided
st ring.
1.
Write a program that takes a tuple o f numbers
from t he user and then calcula tes the s um
and product o f th e elements in the tuple.
2.
Write a program that us es a tuple to s to re
multiple strings and then co unts ho w many
times a s pecific string appears i n the tuple.
Diction ary
1.
write a progra m to s to re and display st udent
marks.
2.
Write a program to s to re and ma nage a
phoneboo k.
Text File
1. ary F ile
Bin
1.
Write a
pro gram that reads a tex t fil e, co unts
the number
Write a program
of words,
to getand s tudent
writ es data(rol
the wordl no ,
count to
name , marks)
ano ther
from
textuser
file.and
w rite onto a
binary file. The pro gram sho uld be able to get
2. fro m the user and write on to the file as
data
lo ng as user wants .
Write a program to convert text to uppercase.
2.
Write a function empadd() whic h will add a
record o f employee in a binar y file "data.dat"
using lis t.Data to be add includ e employee
name, employe e number. Al so write a
functio n empread() which will read all th e
records from t he file.
CSV Fi le
1.
Write a program that reads a CS V file
containin g bo o k details , adds a new bo o k, and
writes the upda ted lis t to a new CSV
file.
2.
Write a program that reads a CS V file
containin g employee info rmation, calculates
the average sal ary, and w rites t he updated
emplo yee list with the average sal ary to a n ew
CSV fil e.
Stack
1.
Write a program doing basic function o n
st ack.
2.
Write a program that implement s a st ack to
st o re info rmation about boo ks and allo ws
adding and rem o ving boo ks.
SQL
1.
Write a SQL pro gram that creat es a table,
ins erts data, ret rieves it, upd ate s records, and
deletes data.
2.
Create tabl e em ployee which c o ntain Empno ,
Ename, Salary, Bo nus, D ept IDand display
Ename which h ave s alary great er than65000.
3.
Create a sm all database to manage contacts
with their name s and pho ne numbers. Write
SQL queries to :
1. Create the t a ble.
2. Insert sample data.
3. Query to l ist all co ntacts.
4. Query to f ind a contact by name.
4.
Create a sim ple tas k tracker wit h tas ks and
their s tatuses . Write SQL queri es to :
1. Create the ta ble.
2. Insert sample data.
3. Query to l ist all tas ks.
4. Query to f ind tasks that are no t completed.
5.
Cons ider the table student and write SQL
queries f o r the fo llo wing:
a)
Dis play the To tal Marks secured by
st udents o f each class .
b) D isplay the Average Ma rks secured by the
st udents o f IP optional subject.
c) D isplay the to tal number o fst udents in
each Class where the numbe r of 2 s tudents ar
6.
Consider the t able student s & subjects an d
writ e S Q L queries for the follo wing:
a) To display complete detail s (from both
tables) of stud ents whose m arks
are
greater
tha n
70.
b) To display the details of subject s whose
credi ts are in the range
of
to
4.
c) T o increase the credi ts of a ll subje cts by
1 which have "Science" in
their
subj ect
names.
d) To display n ames (F Name an d LName) of
student s enrol led in the
"Mathematics "
subject.
7.
Yo u are given a table student a nd a table
courses . Write a sql
command to jo in the two
tables and show the student and there
respective cour ses .
8.
Yo u are give tab le custo mers and table o rders
. Write a SQL pr o gram to l ist allo rders alo ng
■■■\
o rder.
Pytho n
2.
Con nectivit
Write a program
y to
connect pytho n with mysql
1.
using databasecon nectivity an d
perform
Write a program
the to
fo llo wing o peratio ns in database:
connect pytho n with mysql
using
a) D isplay
database
all thecoreco
nnectivity
rds o f an d
st udentsthewho are
perform
fo Medical
in llo wing o
strea
peratio
m ns in database:
A )Create the ta ble
b) Change the
B) Ins ert the rec o rds
Class of D ivakar to 12C
C) D isplay the reco rds using fetchall functio n
[t able
c) D isplay
namethe
is maximum
student] mark o f 12B st udents