0
I cannot understand this syntax error...
I started to learn functions in Python; then when I used in main function in one of my assignments in my course. The code is: def func(num1, num2): if num1 > num2: return (num1 - num2)**2 return (num2 - num1)**2 def main(): num1 = 1 num2 = 2 print(func(num1, num2) if __name__ == "__main__": main() and I get: "invaild syntax".
1 Resposta
+ 2
First you should clear about why are you want to add main in your code.
You should learn about main
https://www.sololearn.com/learning/2488/