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
(list have item) instate (item in list) #87300
Comments
Please append a code to reverse check?like that? print([input() for i in'_'*10] have input()) Instade of: i want to check that: is last input in the inputs or not! |
You could express this as: a = [input() for i in range(10)]
x = input()
print(x in a) This is more clear IMO, because if you want to have something happen before something else, it's clearest to put them on separate lines, one after the other. I also don't like using "a have x" to duplicate the behavior of "x in a", because, |
I agree with Dennis' comments. New syntax should make the language more powerful, not reduce 2 lines to a 1-liner. |
English is a powerful language too. in this one line simple code we check the search keyword after all 10 inputs but in this code we get the search keyword first so we get 10 value!and it have mistake and i said that want to check that: Have is not a duplicated command its a natural way that all people use it in his life in his powerful language like English, Turkish, Persian and etc... Its a powerful command to write codes and think and speak better and/or different! |
powerful languages always reduces multi-lines to one line. |
@Masoud: There's a significant cost to introducing new syntax into Python; there need to be really significant benefits to justify that cost. In this case, the benefits are slight, and nowhere near the threshold needed to justify introducing a new keyword into the language. Closing again; free free to comment further, but please don't re-open the issue. |
Linus makes the Linux kernel without expecting benefits. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: