Python - Hola, me podrían decir que es lo que da error de sintaxis y como lo puedo solucionar?

 
Vista:
sin imagen de perfil

Hola, me podrían decir que es lo que da error de sintaxis y como lo puedo solucionar?

Publicado por Bruno (1 intervención) el 02/10/2021 17:17:10
line = 'Hello Neighbor is a stealth horror game that is currently in early access. In this game, you are exploring your new neighbor's house in order to find out what your neighbor is hiding in the basement. There are puzzles to solve and you need to stay hidden from your neighbor or you will be spotted. If your neighbor sees you, he will chase you around the house. There are hazards throughout the house such as booby traps, spikes, and pits that will kill you if you fall in them.'
File "<stdin>", line 1
line = 'Hello Neighbor is a stealth horror game that is currently in early access. In this game, you are exploring your new neighbor's house in order to find out what your neighbor is hiding in the basement. There are puzzles to solve and you need to stay hidden from your neighbor or you will be spotted. If your neighbor sees you, he will chase you around the house. There are hazards throughout the house such as booby traps, spikes, and pits that will kill you if you fall in them.'
^
SyntaxError: invalid syntax
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Francisco Javier
Val: 249
Ha aumentado su posición en 29 puestos en Python (en relación al último mes)
Gráfica de Python

Hola, me podrían decir que es lo que da error de sintaxis y como lo puedo solucionar?

Publicado por Francisco Javier (313 intervenciones) el 02/10/2021 18:17:01
el apóstrofo de neibor´s has utilizado una comilla y python cree que cierras el string.
puedes ponerl el apóstrofe de acento.

1
2
3
4
5
6
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
line = 'Hello Neighbor is a stealth horror game that is currently in early access. In this game, you are exploring your new neighbor´s house in order to find out what your neighbor is hiding in the basement. There are puzzles to solve and you need to stay hidden from your neighbor or you will be spotted. If your neighbor sees you, he will chase you around the house. There are hazards throughout the house such as booby traps, spikes, and pits that will kill you if you fall in them.'
 
print(line)

O también en vez de poner una comilla simple, puedes utilizar doble comilla y listo.;,


1
2
3
4
5
6
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
line = "Hello Neighbor is a stealth horror game that is currently in early access. In this game, you are exploring your new neighbor's house in order to find out what your neighbor is hiding in the basement. There are puzzles to solve and you need to stay hidden from your neighbor or you will be spotted. If your neighbor sees you, he will chase you around the house. There are hazards throughout the house such as booby traps, spikes, and pits that will kill you if you fall in them."
 
print(line)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar