Learning Python: Repating a String
print “.” * 10
Output:
……….
That’s quality.
I post regular fun on YouTube like me playing the bass and anything else I find fun.
All project work goes through Katapult Media. Business is open. Let’s chat.
print “.” * 10
Output:
……….
That’s quality.
I’m learning Python now and using Learn Python The Hard Way, 2nd Edition. Look for a few posts where I detail my adventure. First up, string and number concatenation.
It is simple but I dig this:
print “Hens”, 25+30/6
Output:
Hens 30
The comma adds a space and you can see it appends the math. It is very subtle and simple but I definitely dig this.
One last example showing the comma a space:
print “Hens”, 25+30/6, “!”
Output:
Hens 30 !