Merge pull request #80 from MinhajMoin/master

Added Answer for Python: Improve the following Code
This commit is contained in:
surister 2020-02-19 19:32:15 +01:00 committed by GitHub
commit 2080ff4d73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3247,6 +3247,18 @@ if char == "a" or char == "y" or char == "o" or char == "e" or char =="u" or ch
print("It's a vowel!") print("It's a vowel!")
``` ```
</summary><br><b> </summary><br><b>
```
if lower(input("Insert a character: ")[0]) in "aieou": # Takes care of multiple characters and small/Capital cases
print("It's a vowel!")
```
OR
```
char = input("Insert a character: ") # For readablity
if lower(char[0]) in "aieou": # Takes care of multiple characters and separate cases
print("It's a vowel!")
```
</b></details> </b></details>
<details> <details>