Ad
Code
Diff
  • def result(n):
        if n < 70:
            return 'fail'
        else:
            return int(n / 10)
    • def result(n): return 'fail' if n < 70 else int(n / 10)
    • def result(n):
    • if n < 70:
    • return 'fail'
    • else:
    • return int(n / 10)

Exam results:

90% = "9"

80% = "8"

70% = "7"

Anything else is a "fail".

def result(perc):
    if perc >= 90:
        return 9
    elif perc >= 80:
        return 8
    elif perc >= 70:
        return 7
    else:
        return "fail"
Code
Diff
  • def cube(a, b, c):
        #your code here
        return a*b*c
        #return 0
    • def kube(a, b, c):
    • def cube(a, b, c):
    • #your code here
    • return a*b*c
    • #return 0