sebast1an17 sebast1an17
  • 01-04-2021
  • Computers and Technology
contestada

Can anyone tell me how this is a SyntaxError! (Python/coding)

Can anyone tell me how this is a SyntaxError Pythoncoding class=

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 06-04-2021

Answer:

The expression on line 9 requires 2 brackets

Explanation:

Given

The attached code

Required

Why syntax error.

On line 9 of the program, we have::

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

The instruction on line 9 gets an integer input from the user. However, this is incorrectly done

To get an integer input, the syntax is:

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

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

In Python 3, this is counted as a syntax error

Answer Link

Otras preguntas

List the perfect squares between 100 and 500 that are even numbers
List the perfect squares between 100 and 500 that are even numbers
how do I round 3.047 to the nearest hundred and show the math
The gram formula weight of phosphoric acid is 98.00 g/mol, and the density of 85.0% phosphoric acid is 1.685 g/mL. Could you describe how ...
Which two countries were the first to declare war on Germany in WWII?
how do you solve m/9 divided by mn squared / 3
What is the molecular formula of a compound made of 25.9% N and 74.1% O? a. NO  b. NO₂ c. N₂O  d. N₂O₅ e. N₂O4₄ It would be great if you could add a few words
Solve the equation x=x+3
What is the value of 1-18+25 if you subtract then add? If you add then subtract?Why is order of operations necessary?
what is 69/25 as a terminating decimal