String Expandtabs in Python
Level 258 keystrokes
This expands tab characters to spaces with a tab size of 4.
Python code
# Create a string with tab characters (\t) between the letters1text = "a\tb\tc"# expandtabs(4) replaces each tab with spaces up to the next multiple of 4# After the 1-character "a", 3 spaces reach column 42result = text.expandtabs(4)# Prints a, b and c separated by 3 spaces each3print(result)Output
a b c
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Python code and how often they appear.
"× 2(× 2)× 2\× 2=× 2.× 1