Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Python Lab_progr_list.docx
Binary file not shown.
14 changes: 14 additions & 0 deletions prog1_grade.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sub1 = input("Enter marks of subject1: ")
sub2 = input("Enter marks of subject2:")
sub3 = input("Enter marks of subject3:")
tot = sub1+sub2+sub3
print "Total marks = " , tot

if tot/3>80:
print "Grade = A"
elif tot/3>60:
print "Grade = B"
elif tot/3>35:
print "Grade = c"
else:
print "Grade = F"
32 changes: 32 additions & 0 deletions prog2_arith.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
n1 = input("Enter the First no.: ")
n2 = input("Enter the Second no.: \n")
while 1:
#print "Enter your choice"
print "Addition - 1"
print "Subtraction - 2"
print "Multiplication - 3"
print "Division - 4"
print "Mod - 5"
print "Exit - 0"
n = input("Enter your choice: ")
if n == 1:
print "Sum = ",n1+n2,"\n"
elif n==2:
print "difference = ",n1-n2,"\n"
elif n==3:
print "product = ",n1*n2,"\n"
elif n==4:
if n2!=0:
print "quotient = ",n1/n2,"\n"
else:
print "Cannot Divide!!\n"
elif n==5:
if n2!=0:
print "Remainder = ",n1%n2,"\n"
else:
print "Cannot Divide!!\n"
elif n==0:
print "Exit\n"
break;
else:
print "Invalid Choice!\n"