Ask coding questions

← Back to all posts
Please help...
LoganGG

I cannot get "simple variables" to work. when i select it, the repl closes. please help!

Answered by Spacecraft [earned 5 cycles]
View Answer
Voters
LoganGG
Comments
hotnewtop
Spacecraft

This should be an easy fix. Inputs are always strings. Your IF statement shows an integer:

Change it to look like this:

LoganGG

@Spacecraft ok thanks!

D3coded

you need an input system and then a system that checks the input...

for example:

w = input('what you want them to input')

and then like an "if" statement like:

if w == 2:
print('whatever you want to print')

or you could do something numerical or mathematical like:

if w == 2:
print(w * 3^4)
or make it print whatever you want it to.