0
It’s always a lot of work to fix indentation after copy and paste, but is there a way to paste with correct indentation? For example:
x = int(input("0 ou 1? "))
if x == 1:
print("ON")
if x == 0:
print("OFF")
After I changed my mind, I put while loop for example, I copied everything and pasted
Before:
while True:
After pasting:
while True:
x = int(input("0 ou 1? "))
if x == 1:
print("ON")
if x == 0:
print("OFF")
Everything is wrong. It must be so:
while True:
x = int(input("0 ou 1? "))
if x == 1:
print("ON")
if x == 0:
print("OFF")
Google Colaboratory has this feature to paste with indentation? And Visual Studio Code?
On several Ides, just mark the block after pasting it and press TAB
– Paulo Marques
This will depend entirely on the tool you use to write code (IDE, text editor, ...).
– jfaccioni