Exercise 03-06:

Write an expression that will be used to decide whether a student is approved. To be approved, all student averages (arithmetic mean) must be greater than or equal to 7 (consider 10 the maximum grade). Consider that the student only takes three subjects and that the grade for each one is stored in the following variables: grade1, grade2, and grade3.

Answer:

##############################################################################
# Python From Scratch
# Author: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2025 - LogiKraft 2025
# Site: https://pythonfromscratch.com
# ISBN: 978-85-7522-949-1 (Paperback), 978-85-7522-950-7 (hardcover), 978-85-7522-951-4 (ebook)
#
# File: chapter 03/exercise-03-06.py.py
##############################################################################
# According to the statement:
grade1 > 7 and grade2 > 7 and grade3 > 7
# In practice, the student is approved if they get a grade greater than or equal to the average, therefore:
grade1 >= 7 and grade2 >= 7 and grade3 >= 7
Click here to download the file