Skip to content

Commit

Permalink
Merge pull request bregman-arie#80 from MinhajMoin/master
Browse files Browse the repository at this point in the history
Added Answer for Python: Improve the following Code
  • Loading branch information
surister authored Feb 19, 2020
2 parents 08b2380 + 8952da6 commit 2080ff4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
```
</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>

<details>
Expand Down

0 comments on commit 2080ff4

Please sign in to comment.