You are on page 1of 4

8/16/2019 Untitled3 - Jupyter Notebook

In [1]: print("program 1->If n is odd, print Weird")


print("If n is even and in the inclusive range of p to q, print Not Weird")
print("If n is even and in the inclusive range of r to s, print Weird")
print("If n is even and greater than m, print Not Weird")
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
print()
n=int(input("Enter a number "))
if(n%2==1):
print("Weird")
else:
p=int(input("Enter the first lower limit "))
q=int(input("Enter the first upper limit "))
r=int(input("Enter the second lower limit "))
s=int(input("Enter the second upper limit "))
m=int(input("Enter the mid-point "))
if(n>p and n<q):
print("Not Weird")
elif(n>r and n<s):
print("Weird")
elif(n>m):
print("Not Weird")
else:
print("Weird")
print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")

program 1->If n is odd, print Weird


If n is even and in the inclusive range of p to q, print Not Weird
If n is even and in the inclusive range of r to s, print Weird
If n is even and greater than m, print Not Weird

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

Enter the quantity 100


Amount to be paid = 9000.0

Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B

In [3]: print("Program 3->A company decided to give bonus of 5% to employee if his/her ye


print()
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")
s=int(input("Enter your Salary "))
t=int(input("Eneter your number of year in the Company"))
if(t>5):
b=s/20
else:
b=0.0
print("Net Bonus Amount=",b)
print("Done by ")
print("Name- Anant Singh Roll NO-08 Class- CSE 2B")

Program 3->A company decided to give bonus of 5% to employee if his/her year of


service is more than 5 years. Ask user for their salary and year of service and
print the net bonus amount

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

Enter the age of person A 34


Enter the age of person B 69
Enter the age of person C 78
Oldest= 78
Youngest= 34

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

Enter the classes held 100


Enter classes Attended 85
Attendance = 85.0 %
Student is Eligible to give Exam

Done by
Name- Anant Singh Roll NO-08 Class- CSE 2B

In [ ]:

localhost:8888/notebooks/Untitled3.ipynb?kernel_name=python3 4/4

You might also like