To print "BBBBB" using the line of code letter = "B"
, you can use a simple loop or string multiplication. Here are a few examples that would accomplish this:
-
Using string multiplication:
print(letter * 5)
-
Using a loop:
for _ in range(5): print(letter, end="")
-
Using the
join
method:print("".join([letter] * 5))
Any of these lines will successfully print "BBBBB" when executed after the line letter = "B"
.