0
What is placeholder variables
2 Answers
+ 6
Variables with intentionally meaningless names, like foo, bar or _ (an underscore sign).
Used mostly for technical reasons - as an iterator or an assignment of unneeded part of a method return value.
+ 6
What Kuba said. An example might be making a list of all the vowels in a string:
my_string = "Hello World!"
vowel_list = [foo for foo in my_string if foo in "aeiou"]
print(vowel_list)
# output: ["e", "o", "o"]