What is the problem with this simple code? I'm new with Python
Also I know Python doesn’t have a do while loop, so instead I use while True, but break, or stop the loop, if n < 0 or n > 23:
import cs50
def main():
height = get_int()
def get_int():
while True:
n = input("Type a number between 0 and 23: ", end="")
if n < 0 or n > 23:
break
return n
if __name__ == "__main__":
main()
Gives me this error
~/workspace/pset6/ $ python mario.py
File "mario.py", line 10
break
^
IndentationError: expected an indented block