+ 1
Any tips on how to improve this code, it's a Nickname generator(sort of)...
8 Answers
+ 2
Noted!
+ 2
No need to categories cons. if vowels are already
You can just do this:
if name[3] not in vowels
+ 2
Your code breaks when the input is less than 4 characters.
You should add some comments at the top of your code, to instruct the user what they should type in the input, maybe give one or two examples.
+ 2
You could simplify a lot by using a string for the character classes, and instead of listing lower and uppercase separately, just convert the character when comparing.
vowels = "aeiou"
if name[3].lower() in vowels (...)
+ 1
Please use the + icon to insert the link to your code in the question description. Link in the title doesn't work, people cannot even have a look at what code you had in mind.
+ 1
Yes you can send a dm but in my experience it is not very reliable, sometimes messages are not transmitted and they cannot contain code, url or special characters. Safer to communicate in comments below your code. Feel free to tag me.
0
Thanks Tibor...though I don't fully understand your code...can I send you a DM?
0
Thanks so much Santa, what a true mentor you aređ