So while trying to use an if statement and an input(), I ran into a slight (potentially skill related) issue: I was trying to do something were if I write 3 into x, the if statement outputs 3, if I write 15 it outputs 15. I want to do this within a singular if statement and not through 26 as I like code that’s small and fast.
I have tried this bit of code
x = input()
if x = [1,2,3,4,...]
[print(1),print(2),print(3),print(4)...]
and this one
x = input()
if x = [1,2,3,4,...]
print([1,2,3,4,...]
but both failed to do what I wanted.
I thought using lists would work but sadly, nope.
MONKE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.