Professional Documents
Culture Documents
Python Problems
Python Problems
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Enter a number 4
Enter the first lower limit 12
Enter the first upper limit 23
Enter the second lower limit 1
Enter the second upper limit 10
Enter the mid-point 5
Weird
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 1/4
8/16/2019 Untitled3 - Jupyter Notebook
In [2]: print("Program 2->A shop will give discount of 10% if the cost of purchased quant
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
print()
n=int(input("Enter the quantity "))
c=int(n*100)
if(c>1000):
d=c/10
c=c-d
print("Amount to be paid =",c)
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
Program 2->A shop will give discount of 10% if the cost of purchased quantity i
s more than 1000.Ask user for quantity and cost, suppose, one unit will cost 10
0. Judge and print total cost for the user.
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Enter your Salary 100000
Eneter your number of year in the Company6
Net Bonus Amount= 5000.0
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 2/4
8/16/2019 Untitled3 - Jupyter Notebook
In [4]: print("Program 4->Take input of age of 3 people from the user and determine oldes
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
print()
a=int(input("Enter the age of person A "))
b=int(input("Enter the age of person B "))
c=int(input("Enter the age of person C "))
print("Oldest=",max(a,b,c))
print("Youngest=",min(a,b,c))
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
Program 4->Take input of age of 3 people from the user and determine oldest and
youngest among them.
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 3/4
8/16/2019 Untitled3 - Jupyter Notebook
In [5]: print("Program 5->A student will not be allowed to sit in exam if his/her attenda
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
print()
c=int(input("Enter the classes held "))
p=int(input("Enter classes Attended "))
a=(p/c)*100
if(a>=75):
print("Attendance =",a,"%")
print("Student is Eligible to give Exam")
else:
print("Attendance =",a,"%")
print("Student is not Eligible to give Exam")
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
Program 5->A student will not be allowed to sit in exam if his/her attendance i
s less than 75%.Take following input from user:1>Number of classes held 2>Numbe
r of classes attended.3>Print percentage of class attended and Is student is al
lowed to sit in exam or not.
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B
In [ ]:
localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 4/4