Example code - Input Output: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

1 March 2024

  • curprev 16:5216:52, 1 March 2024WikiSysop talk contribs 1,131 bytes +1,131 Created page with "== Replacing tabs with spaces == As you may have discovered by now, Python is very sensitive about mixing tabs and spaces in the indentation. This program discovers all the tabs and makes them into spaces. You can decide how many spaces a tab should be.<br> The program is meant to work in a Unix environment, and Jupyter Notebook will tend to make it superfluous. <pre> filename = input("Filename: ") spaceno = int(input("Number of spaces instead of a tab: ")) # Make a st..."