Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> it's actually hard to represent Python code in regular HTML

It is not hard. Just use the right tag. You want the <pre> tag here. Here, fixed it for you:

  def foo(flag):
      if flag:
         print("this is indented")
      print("is this?")


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: