Tagged: string-multiplication

Everything tagged "string-multiplication", newest first.

Coding Practice ·

Python Coding Exercise #61: A Framed Word

A beginner Python exercise on string methods and string multiplication — print a word in the centre of a 30-character frame of asterisks, using center() and a manual version with len() and floor division.

Coding Practice ·

Python Coding Exercise #59: Underlining

A beginner Python exercise on loops, len() and string multiplication — keep asking for strings, print each one underlined with dashes of the same length, and stop when the user presses Enter on an empty line.

Coding Practice ·

Python Coding Exercise #58: A Line and a Rectangle of Hashes

Two beginner Python exercises on repeating output — print a line of hash characters of a chosen width, then repeat that line to draw a rectangle, with a for loop and a while loop compared.

Coding Practice ·

Python Coding Exercise #54: String Multiplied

A beginner Python exercise on string repetition — ask for a string and an amount, then print the string that many times on one line using the * operator.

All tags