Example code - Lists: 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 18:0018:00, 1 March 2024WikiSysop talk contribs 1,044 bytes +1,044 Created page with "== Analysing string content == This is an upgrade of the previous "Determine the input". Here every word, integer and float on the line is counted. Quite a few list concepts are used - on purpose. <pre> inputstring = input("Enter something and I will figure out what it is: ") inlist = inputstring.split() # ints, floats and words count resultlist = [0, 0, 0] resultname = ('ints', 'floats', 'words') # Analyze for item in inlist: try: itempos = 2 result..."