Search code examples
pythonpython-3.xpycharm

I don't get this no matter how many times i recode its still the same


import tkinter as tk


class Calculator:
def __init__(self):

    self.window = tk.Tk()
    self.window.geometry("375*667")
    self.window.resizable(0,0)
    self.window.title("Calculator")


def run(self):
    self.window.mainloop()

this the code I have been working

And Here is The Problem I Have been Facing

 File "C:\Users\Home\Desktop\calculator\calc.py", line 5
    def __init__(self):
    ^
IndentationError: expected an indented block after class definition on line 4

Solution

  • Select all your code from line 5 to 10 and press TAB. Your indentation is wrong, just as your error message says it is.