0

how would I make something that says 'Hi' if you dont put / in front of it?

This is the only way I know: a = input() list(a) if a[0] != '/': print('Hi') its just not usable rlly

21st Jun 2017, 9:02 PM
privrax.
privrax. - avatar
7 Respostas
+ 1
a = input() if a[0] != "/": print("Hi")
21st Jun 2017, 9:15 PM
Adrian
Adrian - avatar
+ 1
No need to change it to a list. The input is always a string, and strings can be seen as lists, where each letter is an element.
21st Jun 2017, 9:18 PM
Adrian
Adrian - avatar
+ 1
Why do you need to convert to the list? a = input() if a != '/': print('Hi') else: print(a)
21st Jun 2017, 9:27 PM
Cika Nikola
Cika Nikola - avatar
0
i wouldn't have to change it to a list?
21st Jun 2017, 9:10 PM
privrax.
privrax. - avatar
0
oh i see. thanks!
21st Jun 2017, 9:19 PM
privrax.
privrax. - avatar
0
i would want people to put something directly after, like a command. "/" is different from "/cmd"
21st Jun 2017, 9:31 PM
privrax.
privrax. - avatar
0
i don't want it to just be "/", is my point
21st Jun 2017, 9:32 PM
privrax.
privrax. - avatar