Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python, print string on the same line for screen output

I am lost on printing a character on the same line.

For example

 card = "--Diamonds--"

Output needed: --Diamonds-- --Diamonds-- --Diamonds-- --Diamonds-- --Diamonds--

The same string variable (not a list) to be repeated on a single line. I don't want it to be a list at this stage, just an image for visuals.

Cheers

like image 294
Months_not_minutes Avatar asked Mar 01 '26 07:03

Months_not_minutes


1 Answers

you could try to do it like this:

print(card*5)
like image 90
Austin He Avatar answered Mar 03 '26 05:03

Austin He



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!