diff --git a/Python Lab_progr_list.docx b/Python Lab_progr_list.docx new file mode 100644 index 0000000..53b98b1 Binary files /dev/null and b/Python Lab_progr_list.docx differ diff --git a/prog1_grade.py b/prog1_grade.py new file mode 100644 index 0000000..20f32cf --- /dev/null +++ b/prog1_grade.py @@ -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" diff --git a/prog2_arith.py b/prog2_arith.py new file mode 100644 index 0000000..a34414f --- /dev/null +++ b/prog2_arith.py @@ -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"