Assignment 1 and 2 Combine Python
Assignment 1 and 2 Combine Python
Write a program that prompts the user to input a number and display if the number is even or odd
2.Write a program that prompts the user to input a year and determine whether the year is a leap year or not.Leap Years are any year
that can be evenly divided by 4. A year that is evenly divisible by 100 is a leap year only if it is also evenly divisible by 400.
bill=200
calls=int(input("enter the number of calls "))
if calls>100 and calls<=150:
bill=bill+(calls-100)*0.60
elif calls>150 and calls<=200:
bill=bill+(50*0.60)+(calls-150)*0.50
elif calls>200:
bill=bill+(50*0.60)+(50*0.50)+(calls-200)*0.40
print("Your monthly telephone bill is ",bill)
1. Write a program that prompts the user to input a number. Program should display the corresponding days to the number. For
example if user type 1 the output should be sunday. If user type 7 the output should be Saturday.
Enter a number5
Thrusday
a=10
b=20
c=a
a=b
b=c
print(a,b)
20 10
Loading [MathJax]/jax/output/CommonHTML/fonts/TeX/fontdata.js
Calculate the average sales from a list.
sales=[20000,50000,100000,55000,72000,120000,66000,22000,44000]
print(sum(sales)/len(sales))
61000.0
Enter the sales value you want to check from the list : 20000
Value is present
The new doubled sales values are : [40000, 100000, 200000, 110000, 144000, 240000, 132000, 44000, 88000]
The new list before removing all the duplicates are : [10, 20, 30, 40, 50, 60, 60]
The new list after removing all the duplicates are : [10, 20, 30, 40, 50, 60]
Enter the temparature in celcius that you want to convert into farenheit : 10
The converted temparature from 10 C is : 50.0 F