-4
# Example for Algorithm Case Study
def naïve(a, b):
    x = a
    y = b
    z = 0
    while x > 0:
        z = z + y
        x = x - 1
    return z

print naïve(4,5)

The output should be 20. Because of syntax error in print statement, I am not getting the answer.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Jyosna
  • 1
  • 2

1 Answers1

2

print in Python 3 is a function, meaning you need to call it with parenthesis:

print(naïve(4,5))
Mureinik
  • 297,002
  • 52
  • 306
  • 350