+ 3
What I should do in the last line? Im facing missing triple quotes.
print("Percentage Calculator") print('''') secured_mark = input("Enter secured mark:") total_mark= input("Enter total mark:") percentage= int(secured_mark)*100 / float(total_mark) print(""") print("You have" ,percentage,"%") if(percentage>60.00): print(""") print("First Division") else: print(""") print("Second Division")
3 Réponses
+ 15
Hello !!
You are facing this error because you are adding 3-4 quotes (single quotes in line 2 are four and double quotes in lines 6,9,12 are three) which are unnecessary. Just make two quotes everywhere. This is the reason you're getting that error message.
+ 9
Some modifications in your code :
print("Percentage Calculator \n")
secured_mark = input("Enter secured mark:")
total_mark= input("Enter total mark:")
percentage= int(secured_mark)*100 / float(total_mark)
print("\nYou have" ,percentage,"%\n")
if(percentage>60.00):
print("First Division")
else:
print("Second Division")
Instead of writing print( " ") every time , just write \n( backslash n ).
It will change the line to a new one.
(\)Backslash is just the opposite of(/) slash
And also the print statement in the last line should be inside the else statement because of indentation.
Thanks
+ 5
Ohh,thanks elder.