擅长:python、mysql、java
<pre><code>counts = [5, 2, 5, 2, 2] # counts
for x_count in counts: # will loop over each element in count
output="" # variable to hold xs
for count in range(x_count): # will loop x_count times
output+="x" # 'x' will be appended to output variable
print(output) # output will be printed
</code></pre>