#The damn colon

8 messages · Page 1 of 1 (latest)

devout walrus
#

Hey guys,how are you?I hope well,But I am in need of help with the following code:
import random
pen=random.randint(0,5)
print('Eu irei pensar em um número de 0 até 5\nVocê tem que tentar adivinhar\nJá pensei')
esc=int(input('Em qual número eu estou pensando?')
if pen == esc:
print('Parabéns, você acertou!')
else:
print('Que pena, você errou era o número {}'.format(ns))

I'm Brazilian so don't find the language strange and the problem is if the program says that the colon is a invalid syntax
Please give a help

simple juniper
#
import random
pen=random.randint(0,5)

print('Eu irei pensar em um número de 0 até 5\nVocê tem que tentar adivinhar\nJá pensei')
esc=int(input('Em qual número eu estou pensando?') #Missing a closing bracket here

if pen == esc:
    print('Parabéns, você acertou!')
else:
    print('Que pena, você errou era o número {}'.format(ns))
#

@devout walrus ^

#

And, using code blocks and sharing the full error trace are also very helpful

#

!formatting

wraith basinBOT
#
Code Formatting

When sharing code with the community, please use the correct formatting for ease of readability.

Example

```py
YOUR CODE HERE
```

Those are back ticks not single quotes, typically the key above TAB

devout walrus
#

@simple juniper

#

Thank you very much