Skip to content

Instantly share code, notes, and snippets.

@trinadhkoya
Created September 22, 2016 06:59
Show Gist options
  • Save trinadhkoya/ff9363f9505b311a41b9853d1dcb6d45 to your computer and use it in GitHub Desktop.
Save trinadhkoya/ff9363f9505b311a41b9853d1dcb6d45 to your computer and use it in GitHub Desktop.
a single * in python changes the whole thing
In this example ,i am working with backend server to validate my credentials.unfortunately i got the error like Wrong Credentials.
putting before * makes sense for me for that f****g problem
def log_in(user, password, security):
if user == "trinadh" and password == "password" and security == "secretkey":
print("Successful Log In")
else:
print("Wrong User Name or Password")
user_details = ["trinadh", "password", "secretkey"]
# in this ,though we are passing the data in a list ,it assumes as a single parameter
log_in(user_details)
# in this ,puttng star before the list data,splits the list data in to list lengh parameters(3)
log_in(*user_details)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment