Professional Documents
Culture Documents
SID: 22103008
Branch: CSE
1. Write a Python program to find average of three numbers entered by the user.
Code:
Output:
tax laws:
Gross Income and the number of dependents must be asked from the user.
Hint:
* No. of dependents)
Code:
3. Write a program that asks the user for a number of seconds and prints out
Name: Agamjot Singh
SID: 22103008
Branch: CSE
how many minutes and seconds that is. For instance, 200 seconds is 3
minutes and 20 seconds. [Hint: Use the //operator to get minutes and the %
Code:
result 75 as string.
Code:
a=25
b='25'
c=25.0
b=int(b)
d=(a+b+c)
d=str(d)
print('Sum is:' +str(d))
print(type(d))
Output:
5. Write a program that prints out the sine and cosine of the angles ranging
Code:
import math
Name: Agamjot Singh
SID: 22103008
Branch: CSE
for x in range(0,360,15):
d=math.sin(x*3.14/180)
e=math.cos(x*3.14/180)
print(str(x) + "---" + str(round(d,4)) +str(round(e,4)))
Output: