You are on page 1of 7

AB Group 10 Assignment

Sanket Andhare MBA21191

Q1.

m1=float(input("Enter the marks of first subject:"))

m2=float(input("Enter the marks of second subject:"))

m3=float(input("Enter the marks of third subject:"))

m4=float(input("Enter the marks of fourth subject:"))

m5=float(input("Enter the marks of fifth subject:"))

total_marks=m1+m2+m3+m4+m5

print("The total marks of all five subjects:",total_marks)

print("The percentage of the total marks is:",total_marks/5,"%")

Q2.

numb=float(input("Enter any number:"))

rem=numb%10

if(rem == 5):

print("The square of the number is:",(numb*numb))

else:

print("The last digit of the entered number is not 5")


sum=0

rem=0

while n>0:

rem=n%10

sum=sum+rem

n=n//10

print("The sum of digits of the number is:",sum)

Q3.

dist_one=float(input("Enter the distance of first destination: "))

dist_two=float(input("Enter the distance of second destination: "))

diff=dist_one-dist_two

abs_diff=abs(diff)

metre_dist=abs_diff*1000

centimetre_dist=abs_diff*100000

mile_dist=abs_diff*0.621371

print("The difference in metres is:",metre_dist)

print("The difference in centimetres is:",centimetre_dist)

print("The difference in miles is:",mile_dist)

Q4.

weight=float(input("Enter the weight of the object: "))

pound_weight=weight*2.20
tonne_weight=weight*0.001

print("The weight in pounds is:",pound_weight)

print("The weight in pounds is:",tonne_weight)

Q5.

dist_metre=float(input("Enter the distance travelled in metres: "))

time_sec=float(input("Enter the time taken in seconds: "))

speed=dist_metre/time_sec

print("The speed of the car is:",speed,"m/s")

Q6.

rad=float(input("Enter the radius of the sphere: "))

vol=4/3*3.14*rad**3

print("The volume of the sphere is:",vol)

Q7.

hun_no=int(input("Enter the number of one hundred rupee notes to be withdrawn: "))

fif_no=int(input("Enter the number of five hundred rupee notes to be withdrawn: "))

thou_no=int(input("Enter the number of one thousand rupee notes to be withdrawn: "))

sum_tot=(100*hun_no)+(500*fif_no)+(1000*thou_no)
print("The total amount withdrawn by the user is: Rs.",sum_tot)

Q8.

year=int(input("Enter the year to be checked: "))

if((year%400 == 0) or (year%100 != 0) and (year%4 == 0)):

print("The year",year,"is a leap year")

else:

print("The year",year,"is not a leap year")

Q9.

hours=float(input("Enter the number of hours you have spent on internet browsing"))

if(hours <= 5):

print("The bill for today is = Rs.",20*hours)

else:

print("The bill for today is = Rs. 100")

Q10.

temp=input("Enter the temperature type: ")

hum=input("Enter the humidity type: ")

if(temp == "Warm" and hum == "Dry"):

print("Play Basketball")

if(temp == "Warm" and hum == "Humid"):


print("Play Tennis")

if(temp == "Cold" and hum == "Dry"):

print("Play Cricket")

if(temp == "Cold" and hum == "Humid"):

print("Swim")

Q11.

numb=float(input("Enter any number:"))

rem=numb%10

if(rem == 5):

print("The square of the number is:",(numb*numb))

else:

print("The last digit of the entered number is not 5")

Q12.

num=int(input("Enter the number of times the sequence should execute"))

for i in range(0,num,1):

print(5**i)

Q13.

num=int(input("Enter the number of times the sequence should execute"))

for i in range(1,num+1,1):

print(i**2)

Q14.
start = 0

sum = 0

while( start <= 500):

sum=sum+start

start=start+5

print("The required sum is",sum)

Q15.

import math

num=float(input("Enter the number: "))

num2=abs(num-int(num))

stre= str(num2)

number_count=len(stre)- 2

print(num2)

print("The number of decimal places:",number_count)

Q16.

a.

import math

num=int(input("Enter the number: "))

b=int(input("Enter the base: "))

sum=0

while (num!=0):
sum=sum+(b**n)/math.factorial(num)

num=num-1

print("The sum of series is",sum)

b.

import math

num=int(input("Enter the number: "))

b=int(input("Enter the base: "))

sum=1

while (num!=0):

sum=sum+(b**num)

num=num-1

print("The sum of series is",sum)

You might also like