You are on page 1of 2

Enjoy Computer with Divyakant Sir

Adajan & Citylight


Std.10,11,12(GSEB/CBSE)
--------------------------------------------------------------------
Chapter 3 : Introduction to Python
Pr13.py
#Count Simple Interest
p = int(input("principal amount :"))
r = int(input("Rate of Intrest :"))
t = int(input("Time in years :"))

si = (p*r*t)/100

print("Simple intrest : ",si)

Pr14.py
#Print hello n times
n = int(input("How many repetation"))
for i in range(n):
print("hello")

Pr15.py
#Fine average of 3 numbers
n1 = int(input(" first number : "))
n2 = int(input(" Second number : "))
n3 = int(input(" third number : "))

Avg=(n1+n2+n3)/3

print("Average of 3 value : ",Avg)

Pr16.py
#Enter age and display in what year you will be of 100 years
age = int(input("Enter your age :"))
nage = (100-age)+2021
print("Your age will be 100 in ",nage)

Pr17.py
#Display characters of a string one by one
country = 'INDIA'
for i in country:
print (i)
Pr18.py
#Area of triangle
a = float(input('Enter the length of first side: '))
b = float(input('Enter the length of second side: '))
c = float(input('Enter the length of third side: '))
s = (a + b + c) / 2
Area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' ,Area)

Pr19.py
#Convert Fahrenheit to Celsius
celsius = float(input("Enter temperature in celsius: "))
fahrenheit = (celsius * 9/5) + 32
print('%.2f Celsius is: %0.2f Fahrenheit' %(celsius, fahrenheit))

Pr20.py
stRecord = ['Raman','A-36',[56,98,99,72,69],78.8]

# percentage of the student


print(stRecord[3])

# Marks in the fifth subject


list1 = stRecord[2]
print(list1[4])

# Maximum marks of the student


list2 = stRecord[2]
list2.sort()
print(list2[4])

#Change the name of the student from ‘Raman’ to ‘Raghav’


stRecord[0] = 'Raghav'

print(stRecord)

You might also like