Practicla Record
Practicla Record
#3.Write a python program to print the square root of a given number using library
module
import math
'''n=int(input("enter a number to find square root"))
print(math.sqrt(n))'''
#4.Write a program to calculate the area of a rectangle given the length and
breadth are 50 and 20 respectively.
'''length = 50
breadth = 20
area=length*breadth
print("area of a rectangle is",area)'''
#5.Write a program to read name and marks of a student and display the total marks.
'''name=input("enter student name")
it=int(input("enter IT marks"))
ai=int(input("enter artifitial intelligence marks"))
cs=int(input("enter computer science marks"))
tot=cs+ai+it
print("name of the studnet", name)
print("total marks of the student",tot)'''
#6.Write a program to display even numbers between 10 and 20.
'''for i in range(10,21,2):
print(i)'''
#7.Write a python program to check whether the given number is even or odd.
'''n=int(input("enter a number"))
if n%2==0:
print(n,"is even number")
else:
print(n,"is odd number")'''
#8.Write a python program to create a user defined list.
'''l=[]
n=int(input("enter how many elements"))
for i in range(1,n+1):
ele=int(input("enter element to add in the list"))
l.append(ele)
print(l)'''
#9.9.Write a python program to create a user defined dictionary
'''d={}
n=int(input("how many values"))
for i in range(1,n+1):
key=int(input("enter roll number"))
value=input("enter name")
d[key]=value
print(d)'''
#10.Write a python program to create a CSV file.
f=open("sample.csv","w")
f.write("I am learning python csv files")
f.close()