#๐ why am I getting parsing failed invalid syntax line 2
36 messages ยท Page 1 of 1 (latest)
@covert meadow
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
if I delete the () at the end of line 2 it gives me no name passwordToHashed in module Assignment7 eventhough there literally is
assignment 7 :
import hashlib
def passwordToHashed(password):
hashedPassword = password.encode("utf-8")
myMD5Hash = hashlib.md5()
myMD5Hash.update(hashedPassword)
hashedPassword = myMD5Hash.hexdigest()
return(hashedPassword)
cannot reproduce the import error, have you made sure your file is saved?
I believe I just saved them both
@covert meadow your indentations are not all aligned. You need them all the same.
Indents only change when you place code inside something, like inside a def, an if, a while and so forth.
It would help to see the SyntaxError itself in all its glory.
They're not aligned because I typed them out and not copy paste into here
yes
Can you not copy/paste the real code here?
Its on my laptop
Ah. Drop the () from the import. You're importing a name, not calling the name.
now I get a using variable hashedPassword before assignment on line 4
do i move it to line 3?
do you mean to use the function you defined in Assignment7?
Need to see it. It's obscured. And you need to say which file elicits the error.
hashedPassword and passwordToHased are different words.
This assignment is probably trying to teach you how to use functions from different files yes?
yes
I know why its messed up
Thank you๐
Thank you๐
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.