I am trying to make a program using Python that will auto indent the next line of string when it encounters certain characters such as braces.
For example:
public class Example{
--indent--> public static void main (String[]args){
--indent--> System.out.println("Hello");
}
}
I can't seem to grasp what I need to code in order to achieve that.
Any kind of help will be much appreciated!
honestly, the exact way you set up your code depends on if you're doing other things to it to "pretty print" it. a rough outline of something could look like this
would output