Arnab Cs Project
Arnab Cs Project
INTERNATIONAL
SCHOOL
COMPUTER
SCIENCE
PRACTICAL FILE
2024-2025
Code:
Output:
Ques: enter details of a student in a text file
Code:
Output:
Text File:
Ques: conver5ng octal numbers to various other types
Code:
Output:
Ques: Calcula5ng simple interest by using func5ons
Code:
Output:
Ques: Maximum value at index in dic5onary
Code:
Output:
Ques: Sor5ng a list in a different way rather than
bubble sort
Code:
Output:
Ques: A func5on that takes amount-in-dollars and
dollar-to-rupee conversion price; it then returns the
amount converted to rupees
Code:
Output:
Ques: A func5on that receives two numbers and
generates a random number from that range. Using
this func5on, the main program should be able to
print three numbers randomly.
Code:
Output:
Ques: A func5on namely nth Root that receives two
parameters x and n and returns nth root of x i.e.,
x^(1/n). The default value of n is 2
Code:
Output:
Ques: A program to count the words "to" and "the"
present in a text file "Poem.txt".
Code:
Output:
Text file:
Ques: A method func5on DISPLAY WORDS () in python
to read lines from a text file Poem.txt, and display
those words, which are less than 4 characters.
Code:
Output:
Ques: A func5on in Python to count and display the
number of lines star5ng with alphabet 'A' present in a
text file "Poem.txt”
Code:
Output:
Ques: A program that should prompt the user to type
some sentence followed by "enter". It should then
print the original sentence and the following sta5s5cs
rela5ng to the sentence.
Code:
Output:
Ques: A program that prompts for a phone number of
10 digits and two dashes, with dashes aaer the area
code and the next three numbers.
Code:
Output:
Ques: a program that reads characters from the keyboard one by
one. All lower case characters get stored inside the file lower, all
upper case characters get stored inside the file upper and all other
characters get stored inside file others.
Code:
Output:
Text File output:
Ques: To enter books details in stack by using push,
display and exit func5on.
Code:
Output:
MySQL
1: To create the given table and name as stu1 and insert values:
mysql> create table stu1(sno int, name varchar(20), stipend int, stream
varchar(30), avgmarks float(5,2), grade char(1), class varchar(5));
mysql> insert into stu1 values(1, ‘karan’ ,400, ‘medical’, 78.5, ‘B’, ‘12B’);
(adding some more values into this table, let the table be as shown below)
2: To display name and avgmarks in descending order:
mysql> select name, avgmarks from stu1 order by avgmarks desc;