0% found this document useful (0 votes)
16 views13 pages

Assignment 1 Manish 216301051-1-13

I am boy

Uploaded by

216301012
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)
16 views13 pages

Assignment 1 Manish 216301051-1-13

I am boy

Uploaded by

216301012
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/ 13

Q.

1 Simple Interest
Write a python script to ask the principal, rate of
interest and time from the user and then calculate the
simple interest and print the appropriate result.
Q.2 Arithmetic Progression
You are given first three entries of an arithmetic
progression. You have to calculate the common
difference and print it.
Q.3 Sum of A.P
Write a python script to find the sum of an A.P.
containing 12 terms whose first term is 3 and the last
term is -15.
Q4. First Term of AP
Given an A.P. containing 4 terms whose sum is 24 and
the last term is 12.Find the first term using python.
Q5. Rectangular Area
You are given a rectangle in a plane. The corner
coordinates of this rectangle is provided to you. You
have to print the amount of area of the plane covered
by this rectangles. The end coordinates are provided as
four integral values: x1, y1, x2, y2. It is given that x1 <
x2 and y1 <y2.
Q6. Seconds Convertor
Write a python program to convert the seconds
inputted from the user into Hours, minutes and
seconds.
Q7. Area of Triangle
Write a program that takes, from the user the length of
the base and the height of the triangle. Make the
function output the resulting area of the triangle as an
integer.
Q8. Square of a number
Write a program that takes input from the user a
number and calculates the square of the number using
functions in python.
Q9. Average of the numbers
Write a program to input marks of three tests of a
student (all integers). Then calculate and print the
average of all test marks.
Q10. Alarm calculator
Many people keep time using a 24 hour clock (11 is
11am and 23 is 11pm, 0 is midnight). If it is currently 13
and you set your alarm to go off in 50 hours, it will be
15 (3pm). Write a Python program to solve the general
version of the above problem. Ask the user for the time
now (in hours),and then ask for the number of hours to
wait for the alarm. Your program should output what
the time will be on the clock when the alarm goes off.
Q11. Day Predictor
It is possible to name the days 0 thru 6 where day 0 is
Sunday and day 6 is Saturday. If you go on a wonderful
holiday leaving on day number 3 (a Wednesday) and
you return home after 10 nights you would return
home on a Saturday (day 6). Write a general version of
the program which asks for the starting day number,
and the length of your stay, and it will tell you the
number of day of the week you will return on.
Q12. Temperature Convertor
Our young school students are learning to read the
temperature in Fahrenheit and Celsius. Write a
program to help them convert the given Fahrenheit
temperature into Celsius. (Hint: Use functions).

You might also like