Post Reply 
Python to RPN converter
02-18-2018, 02:32 PM (This post was last modified: 02-18-2018 04:15 PM by StephenG1CMZ.)
Post: #19
RE: Python to RPN converter
(02-18-2018 10:27 AM)tcab Wrote:  Any "unindent does not match any outer indentation level" error messages simply means that your code indenting is inconsistent somewhere. Indentation is critical to Python code - you soon get used to it. Read up about Python's indention rules here.

Just to be clear, I was not querying Python's indentation rules.
I was querying the functionality of the on-line Python convertor.

Here is the code it is objecting to:
Code:

def demo2():
2
    total = 0
3
    for i in range(10):
4
        result = calc_something(i, 5)
5
        print('Counter', i, 'result=', total)
6
        total += result
7
    print('FinalZtotal was:', total)
8

9
def calc_something(a,b):
10
    # adds two numbers then squares them
11
    return (a + b)**2
The changes from the on-line demo are:
Name changed from demo to demo2
String changed from "Final ..." to "FinalZ..." (i.e. space changed to Z, string length unchanged)
The changes were made by tapping into the on-screen demo window in the convertor...
I haven't tried pasting new source files yet.
And the error is:
Code:

unindent does not match any outer indentation level, line: 7
    print('FinalZtotal was:', total)
                                    ^
So, how do I fix the indentation?
Tested on both Android 6 and Android 5

Update: Uploading new source to the convertor also seems impractical. I have to delete demo from the window several times - the text keeps re-appearing. When I do finally get an empty window, guess what is in my paste buffer instead of my source? It did work once and the compiler objected to the last line.
Suely there must be a "New source" button somewhere but I haven't seen it.

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Python to RPN converter - tcab - 02-16-2018, 05:27 AM
RE: Python to RPN converter - pier4r - 02-16-2018, 06:26 AM
RE: Python to RPN converter - salvomic - 02-16-2018, 09:47 AM
RE: Python to RPN converter - rprosperi - 02-16-2018, 02:34 PM
RE: Python to RPN converter - charger73 - 02-16-2018, 02:38 PM
RE: Python to RPN converter - Nigel (UK) - 02-16-2018, 03:04 PM
RE: Python to RPN converter - tcab - 02-16-2018, 11:06 PM
RE: Python to RPN converter - compsystems - 02-17-2018, 01:06 AM
RE: Python to RPN converter - StephenG1CMZ - 02-18-2018, 09:21 AM
RE: Python to RPN converter - tcab - 02-18-2018, 10:27 AM
RE: Python to RPN converter - StephenG1CMZ - 02-18-2018 02:32 PM
RE: Python to RPN converter - tcab - 02-18-2018, 09:25 PM
RE: Python to RPN converter - Thomas Okken - 02-18-2018, 12:59 PM
RE: Python to RPN converter - tcab - 02-18-2018, 01:13 PM
RE: Python to RPN converter - StephenG1CMZ - 02-19-2018, 07:16 AM
RE: Python to RPN converter - tcab - 02-19-2018, 07:29 AM
RE: Python to RPN converter - StephenG1CMZ - 02-19-2018, 07:48 AM
RE: Python to RPN converter - tcab - 02-19-2018, 08:17 AM
RE: Python to RPN converter - pier4r - 02-19-2018, 11:15 AM
RE: Python to RPN converter - StephenG1CMZ - 02-19-2018, 07:36 PM
RE: Python to RPN converter - StephenG1CMZ - 02-20-2018, 02:28 PM
RE: Python to RPN converter - tcab - 02-20-2018, 10:39 PM
RE: Python to RPN converter - MikeOShea - 06-01-2018, 01:39 AM
RE: Python to RPN converter - Thomas Klemm - 06-23-2018, 10:33 PM
RE: Python to RPN converter - tcab - 06-24-2018, 10:56 PM
RE: Python to RPN converter - Thomas Klemm - 06-25-2018, 05:00 PM
RE: Python to RPN converter - Thomas Klemm - 06-28-2018, 04:07 PM
RE: Python to RPN converter - Thomas Klemm - 06-28-2018, 08:04 PM
RE: Python to RPN converter - tcab - 11-02-2018, 04:43 AM
RE: Python to RPN converter - Namir - 11-03-2018, 07:32 PM
RE: Python to RPN converter - tcab - 11-04-2018, 06:06 AM
RE: Python to RPN converter - Thomas Okken - 11-04-2018, 02:02 PM
RE: Python to RPN converter - tcab - 11-04-2018, 10:25 PM
RE: Python to RPN converter - Namir - 11-04-2018, 08:07 PM
RE: Python to RPN converter - tcab - 11-04-2018, 09:59 PM
RE: Python to RPN converter - cdmackay - 12-11-2018, 07:05 PM
RE: Python to RPN converter - tcab - 12-11-2018, 10:46 PM
RE: Python to RPN converter - cdmackay - 12-11-2018, 11:27 PM
RE: Python to RPN converter - compsystems - 06-09-2020, 04:12 PM
RE: Python to RPN converter - tcab - 06-12-2021, 03:42 AM
RE: Python to RPN converter - tcab - 06-12-2021, 03:54 AM



User(s) browsing this thread: 1 Guest(s)