To repeat a specific string in an algorithm in Python, a coder would use a _____.

module

trinket

modulo

for loop

1 answer

To repeat a specific string in an algorithm in Python, a coder would use a for loop.

For example:

string_to_repeat = "Hello"
for _ in range(5):
    print(string_to_repeat)

This would print "Hello" five times.