Quote:def dave_check(user_name): if user_name= "Dave" : return "Get off my computer Dave!" # Enter a user name here, make sure to make it a string user_name = "Dave" print(dave_check(user_name))
File "C:/Users/jaide/PycharmProjects/HelloWorld/venv/app.py", line 2 if user_name= "Dave" : ^ SyntaxError: invalid syntax
Quote: if user_name="Dave":
=
==
' = ' this is used for assignment operator,, but you need ' == ' for comparison .. thats why it show an invalid syntax error .. and check you ' code indentation '
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)