avocadont69
avocadont69 avocadont69
  • 23-03-2022
  • Computers and Technology
contestada

[Python] Spot the errors in the code
x = int(input()
if x == 5
print(x is equal to 5)
else:
print("x is not equal to 5")

Respuesta :

beinggreat78
beinggreat78 beinggreat78
  • 23-03-2022

Answer:

  1. There's no string double quotes in the print statement on line 3.
  2. The input statement on line 1 is wrong. It should actually be the following ⇒ print(input(Hello World))

All print statements must contain double quotes around a string. Otherwise, it will be interpreted as a number, and will lead to an error.

Answer Link

Otras preguntas

name of 4 men who were called"The Empire Builders" of the California Railroad system?
What are two types of selective breeding and how do they compare?
what did republicans think about slavery in territories
You are an urban planner assessing the growth of a city. Ten years ago, the city's population was 249,583. Its current population is 318,270. By about what perc
Find the 50th term of this arithmetic sequence: 5, 13, 21, 29, . . .
A researcher calculates the expected value for the number of girls in three births. He gets a result of 1.5. He then rounds the result to 2, saying that it is
What are two types of selective breeding and how do they compare?
if angela swims 1,700 meters in 40 minutes what is her unit rate
Which of the following is an equivalent simplified expression for 2(4x + 7) – 3(2x – 4) ? A. x + 2 B. 2x + 2 C. 2x + 26 D. 3x + 10 E. 3x + 11 Can anyone explain
Which of the following is an equivalent simplified expression for 2(4x + 7) – 3(2x – 4) ? A. x + 2 B. 2x + 2 C. 2x + 26 D. 3x + 10 E. 3x + 11 Can anyone explain