[Solved] How can I center an integer variable in a string?


I think I see your problem: you’ve mistaken the meta-syntax of documentation for Python syntax.

When a document describes a command with optional fields, brackets denote the option parts. This description style is at least 45 years old, dating back to the days when IBM drove all things computer in the western hemisphere. For help in writing your command, see the examples farther down.

In your case, you need something like

print(str(count).center(10))

This is a method of the string class; it operates on the string with which you call it. In your case, that string is str(count). Can you follow the rest from there?

solved How can I center an integer variable in a string?