As a beginner to Python I got these tasks by the teacher to finish and I'm stuck on one of them. It's about finding the consonants in a word using a for-loop and then create a string with those consonants.
The code I have is:
consonants = ["qwrtpsdfghjklzxcvbnm"]
summer_word = "icecream"
new_word = ""
for consonants in summer_word:
new_word += consonants
ANSWER = new_word
The for-loop I get but it's the concatenation I don't really get. If I use new_word = [] it becomes a list, so I should use the ""? It should become a string if you concatenate a number of strings or characters, right? If you have an int you have to use str(int) in order to concatenate that as well.
But, how do I create this string of consonants? I think my code is sound but it doesn't play out.
Regards