Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking if key is in list #24

Open
PeterGardas opened this issue May 23, 2018 · 1 comment
Open

Checking if key is in list #24

PeterGardas opened this issue May 23, 2018 · 1 comment

Comments

@PeterGardas
Copy link

PeterGardas commented May 23, 2018

Hello
I would like to make a simple grab keys python3 script, that gets the keys and then checks the list if there is a key or not and then returns an array. I tried this:
#Takes string returns array! def keys_to_array(key): if key == "w": return [0, 1, 0] elif key == "a": return [1, 0, 0] elif key == "d": return [0, 0, 1] else: return "Not working as supposed or None!"

Please help it is not working as supposed and returning Not working as supposed or None!. I suppose there is a problem that the key that is returning is not a string but NoneType. But i dont know

Petr Gardas

@JeffHoogland
Copy link
Owner

We can't actually help determine why your code isn't working without seeing your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants