Learn English – What does “would be in” mean in this sentence

meaningmeaning-in-context

I have been learning Python programming from a book and I came across a sentence which I can't understand!

When you enter this code in the IDLE, it will automatically
indent, so be sure to press the backspace or delete key once you’ve
typed each print statement, so that your if, elif, and else statements
will start at the far-left margin. This is the same position
the if statement would be in if the prompt (>>>) were absent.

I just don't get this part:

This is the same position the if statement would be in if the prompt (>>>) were absent.

What does "would be in" mean?

Best Answer

I text talks about a case like the following

if x:
   print("Hello")
else:
   print("Goodbye")

That's the correct way to format. Wrong would be:

if x:
   print("Hello")
   else:
       print("Goodbye")

To prevent the wrong way from happening you have to hit the delete key after you wrote print("Hello") and pressed <Enter>.

What's with the prompt? If you are in IDLE the correct text will look like:

>>> if x:
        print("hello")
else:
        print("goodbye")

The sentence says that if would be at the same height as else if the >>> wouldn't be there. As far as python is concerned if and else are on the same level on indention.

Related Topic