54.7k views
4 votes
Can someone tell me how this is a SyntaxError! (Python3)

Can someone tell me how this is a SyntaxError! (Python3)-example-1

1 Answer

4 votes

Answer:

The expression on line 9 required 2 brackets

Step-by-step explanation:

Given

The attached code

Required

Why syntax error.

The error points to line 10, but the error is actually from line 9

To get an integer input, the syntax is:

variable-name = int(input("Prompt"))

From the attached code, the line 9 is:

amount = int(input("Enter cheese order weight: ")

By comparing the syntax to the actual code on line 9, only 1 of the brackets is closed.

This, in Python 3 is a sytax error

User MLeblanc
by
4.4k points