Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SL

NO. PRACTICAL NAME

1 Program to calculate factorial of a number

2 Program to generate Fibonacci series to the given nth term

3 Program to check whether the given number is prime or not

4 Program to read the content of a file and display the total number of consonants, vowels and lower case
characters

5 Program to search any word in a given string

6 Program to read and display a file line by line with each word separated by @

7 Program to create binary file containing Roll no. and name and search the Roll no. and display name

8 Program to create binary file to containing Roll no., name and marks and update marks of entered Roll no.

9 Program to read content of a file line by line and write it to another file except for the lines containing ‘a’ in it

10 Program containing a function that takes a sorted list and number as arguments and search for the number in
the list using binary search

11 Program to write and read data from a CSV file consisting item code, item name, quantity and price and search
for a particular item using item code
12 Program to sort a list using bubble sort

13 Program to sort a list using insertion sort

14 Program to guess a number game using random

15 Program to rotate the elements of a list (Palindrome)

16 Program to implement stack in python using list

17 Program to get HCF of two numbers

18 Program to check if a number is a happy number or not

19 SQL Connectivity: Create a Table

20 SQL Connectivity: Insert data in Table

SQL PRACTICAL LIST


1 Consider the following tables CABHUB and CUSTOMER.

Write SQL commands for the statements (i) to (V) and give outputs also:

2 Consider the following tables STORE and ITEM.

Write SQL commands for the statements (i) to (V) and give outputs also:

3 Consider the following tables STORE and ITEM.

Write SQL commands for the statements (i) to (V) and give outputs also:

4 Consider the following tables PRODUCT and CLIENT . Write SQL commands for the statements (i) to (V) and give
outputs also:

5 Consider the following tables STATIONARY and CONSUMER . Write SQL commands for the statements(i)to(V)
and give outputs
16. Program to implement stack in python
using list
def push(stack,item):

stack.append(item)

def pop(stack):

if len(stack)==0:

print('\nUNDERFLOW. Stack is empty!')

else:

stack.pop()

def display(stack):

if len(stack)==0:

print('\nUNDERFLOW. Stack is empty!')

else:

for i in stack:

print(i)

stack=[]

ch=1

while ch in [1,2,3]:

print('''\n*********STACK MENU*********

1) PUSH
19. SQL Connectivity: Create a Table

import mysql.connector as sqlc


con=sqlc.connect(host='localhost',user='root',password='1234',database='proj
ect')
cur=con.cursor()
cur.execute("Create table loginn (username varchar(50), password
varchar(50));")
print("Table is created successfully!!!")
con.commit()
con.close()
20. SQL Connectivity: Insert data in Table
import mysql.connector as sqlc
con=sqlc.connect(host='localhost',user='root',password='1234',database='proj
ect')
cur=con.cursor()
fname=input('Enter the name of your file')
dos=input('Enter date of submission: in YYYY/MM/DD')
cur.execute('Insert into adil value("'+fname+'", "'+dos+'");')
con.commit()

You might also like