omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How to Double indent in Repl feature of Pythonista Pikey keyboard

    Pythonista
    pikey keyboard repl feature pythonista
    2
    2
    1214
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DaCondor54
      DaCondor54 last edited by

      Hi, I’ve discovered pythonista keyboard pikey and I wanted to use the feature REPL which lets you write code anywhere where you can type. I wanted to write a nested for loop but I keep getting indentation errors. I wrote
      “>>> for x in range (10):
      ... for y in range(10):
      ... print(‘#’, end =‘’) # I don’t know how to indent this line
      ... print()
      The “>>>” means start of code and “... ”( with 3 spaces) are for indentation I think? I would like to know if it’s possible to create a table of ‘#’ or to double indent in this REPL feature. Thanks

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @DaCondor54 last edited by

        @DaCondor54, ”...” is just indicating that the code continues, corresponding to the ”>>>” on the first line.

        One space after the dots corresponds to the space between ”>” and ”for” on the first line.

        Thus, indent in respect to the ”f” in ”for” on the first line. If you use 2-space indents, the second line should have 1+ 2 spaces after the dots, the third line 1+ 4, and the last line 1 + 2 again.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Powered by NodeBB Forums | Contributors