.Assign your Term1 Marks of English to variable MARK1 and Term2 Marks of English to variable MARK2. Write a program to store total marks in variable Total and display the result. pls answer About the author Melody
Store total marks – Python First we would take a user input string in the MARK1, after that same as MARK1 we will take a user input in MARK2 also. We know that the [tex]\tt input()[/tex] function returns a string, string is one of the basis types in Python that store text. To convert it to a number, we can use the [tex]\tt{int()}[/tex] function. We then simply add the two numbers of MARK1 and MARK2 and after that will display the result. [tex]\rule{300}{1}[/tex] The Program MARK1=int(input(‘Enter your Term1 marks of English:’)) MARK2=int(input(‘Enter your Term2 marks of English:’)) print(“The total marks is”, + (MARK1+MARK2)) [tex]\rule{300}{1}[/tex] Sample Run Enter your Term1 marks of English: 83 Enter your Term2 marks of English: 78 The total marks is 161 Reply
Required Answer: m1=(int)(input(“Enter mark1:-“)) m2=(int)(input(“Enter mark2:-“)) total=m1+m2 print(“Total”,total) #you can also write print(“Total”,(m1+m2)) Reply
Store total marks – Python
First we would take a user input string in the MARK1, after that same as MARK1 we will take a user input in MARK2 also.
We know that the [tex]\tt input()[/tex] function returns a string, string is one of the basis types in Python that store text.
To convert it to a number, we can use the [tex]\tt{int()}[/tex] function.
We then simply add the two numbers of MARK1 and MARK2 and after that will display the result.
[tex]\rule{300}{1}[/tex]
The Program
MARK1=int(input(‘Enter your Term1 marks of English:’))
MARK2=int(input(‘Enter your Term2 marks of English:’))
print(“The total marks is”, + (MARK1+MARK2))
[tex]\rule{300}{1}[/tex]
Sample Run
Enter your Term1 marks of English: 83
Enter your Term2 marks of English: 78
The total marks is 161
Required Answer:
m1=(int)(input(“Enter mark1:-“))
m2=(int)(input(“Enter mark2:-“))
total=m1+m2
print(“Total”,total)
#you can also write print(“Total”,(m1+m2))