0% found this document useful (0 votes)
8 views9 pages

Cs Practical June 9 25

The document outlines various Python programming tasks including checking for palindromes, generating Fibonacci series, calculating electricity charges, and finding factors, factorials, and prime numbers. It also includes tasks for calculating BMI, GCD, and LCM, as well as working with lists and dictionaries. Additionally, it provides SQL queries for employee data management from a database table.

Uploaded by

debayankar23
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)
8 views9 pages

Cs Practical June 9 25

The document outlines various Python programming tasks including checking for palindromes, generating Fibonacci series, calculating electricity charges, and finding factors, factorials, and prime numbers. It also includes tasks for calculating BMI, GCD, and LCM, as well as working with lists and dictionaries. Additionally, it provides SQL queries for employee data management from a database table.

Uploaded by

debayankar23
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/ 9

1 Check the number is palindrome or not

num=int(input("Enter a number"))
rem=0
rev=0
num1=num
while num>0:
rem=num%10
rev=rev*10+rem
num=num//10

if num1==rev:
print("Palindrome")
else:
print("Not palindrome")

2 Create Fibanocci Series after accepting the limit.


limit=int(input("Enter the limit"))
a=-1
b=1
print("---------------------------------------------------")
for i in range(limit):
c=a+b
a=b
b=c

print(c,end="<-->")
print()
print("---------------------------------------------------")
3 Write a python program to find
1. FACTORS
2. FACTORIAL
3. PRIME OR NOT
4 Create a program to calculate electricity Charges and this rates:
1 to 100 units – 1.5Rs
101 to 200 units – 2.5Rs
201 to 300 units – 4Rs
300 to 350 units – 5Rs
Above 350 – Fixed charge 1500Rs
unit=int(input("Enter the Electricity consumed"))
name=input("Name of the Consumer")
if unit<=100:
amount=unit*1.5
elif unit<=200:
amount=100*1.5+(unit-100)*2.5
elif unit<=300:
amount=100*1.5+100*2.5+(unit-200)*4
elif unit<=350:
amount=100*1.5+100*2.5+100*4+(unit-300)*5
else:
amount=100*1.5+100*2.5+100*4+(unit-300)*5+1500
print("Dear :",name,"Your electricity Charge is :",amount)
5 Accept a number and find (1) Armstrong number (2) Digit sum

6 Accept a list of numbers and find the largest and smallest number
7 Accept a list and find the position of a number accepted from user.

8 Write a program to accept a list of number and find the frequency of each item in the List
using the dictionary.
9 Manu driven program to implement the function in List.
10 Manu driven program to implement the function in Dictionary.
11 Write a program to find the GCD of two numbers.

12 Write a python program to find the LCM of two numbers.


13
Write a program to calculate BMI and print the nutritional status as per the following table:
Nutritional Status WHO criteria BMI
cut-off
Underweight <18.5
Normal 18.5-24.9
Overweight 25-29.9
Obese ≥30
14
Write a program to find the sum of the series :
s=1+x+x ²+x ³+x ⁴…+x ⁿ

15
Write a program a menu driven program
1. To input State : Capital pair as the key value pair
2. Search the capital of a state accepted from user.
3. Display all key value pair
4. Exit
16

i. Display all the records (all columns) from table Emp.


ii. Display EmpNo and EName of all employees from table Emp.
iii. Display Ename, Sal and Sal added with Comm from table Emp.
iv. Display EName joined with Job with heading “Employee”, Sal*12 as “Total Salary”
from table Emp.
v. Display distinct Sal of employees from table Emp..
vi. Write a query to display EName and Sal of Employees whose salary is greater than or
equal to 3000 from table Emp.
vii. Write a Query to display employee name, salary and department number who are
not getting commission from table Emp.
viii. Write a Query to display employee Number, name, sal and sal*12 as Annual Salary
whose commission is not NULL from table Emp.
ix. Write a Query to display employee name and salary of those employee who don’t
have there salary in the range of 1500 to 2000
x. Write a Query to display the name, job title and salary of employee who do not have
manager.

You might also like