Create a function of name check_marks(). The function will receive two marks. The function should add these two marks and return “Pass” if the sum is greater than or equal to 60 and return “Fail” if the sum is less than 60.For example, if the marks are 39 and 45, then the function return "Pass" because the sum of 39 and 45 is 84 which is greater than 60.
Question
Create a function of name check_marks(). The function will receive two marks. The function should add these two marks and return “Pass” if the sum is greater than or equal to 60 and return “Fail” if the sum is less than 60.For example, if the marks are 39 and 45, then the function return "Pass" because the sum of 39 and 45 is 84 which is greater than 60.
Solution 1
Sure, here is the function in Python:
def check_marks(mark1, mark2):
# Add the two marks
sum_marks = mark1 + mark2
# Check if the sum is greater than or equal to 60
if sum_marks >= 60:
return "Pass"
else:
return "Fail"
You can call this function with two marks as arguments. For example:
print(check_marks(39, 45)) # This will output: Pass
Solution 2
Sure, here is the function in Python:
def check_marks(mark1, mark2):
# Add the two marks
sum_marks = mark1 + mark2
# Check if the sum is greater than or equal to 60
if sum_marks >= 60:
return "Pass"
else:
return "Fail"
You can use this function by calling it with two marks as arguments. For example:
print(check_marks(39, 45)) # This will output: Pass
Similar Questions
Step 1 (3 pts). Complete the CheckSingles() function. Return the sum of all values that match parameter goal. Update the FindHighScore() function using a loop to call CheckSingles() six times with parameters being 1 - 6. Return the highest score from all function calls. Submit for grading to confirm two tests pass.Ex: If input is:2 4 1 5 4the output is:High score: 8
Write a program to accept marks from 1-100as input from user. If the user enters <40as an input or if user enters any negative number, or >100 user defined exception should begenerated.
Write a C program using structure student which allows users to input details for three students including their names, roll numbers, and marks in 5 subjects. Use a function calculateTotalMarks(struct Student) which calculates the total marks and percentage for each student and displays the information. Each subject test is for 10 marks. Total marks = 50. Percentage = (marks obtained/total marks)*100.
A student marking system receives input of student’s total mark from lecturer. If a studentgets total mark of 75 or above, the system will print ‘A’. If a student’s mark is between 65 to74, the system will print out ‘B’. While ‘C’ will be printed out if the mark is between 50 to 64.Whichever the total mark is below 50, ‘F’ will be printed
# Write a function in python which accept a list of marks of students and return the# minimum mark, maximum mark and the average marks. Use the same function to test
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.