#๐Ÿ”’ Basic coding question CS50P

21 messages ยท Page 1 of 1 (latest)

limber haven
#

Hey, IDK why my code is not working
one of the things it looks at is seeing if ForTy TwO works. I assumed putting .lower() into it makes it all lower case but my case isnt catching it for some reason?

Whats the reason for it not working? Have I put in the code wrong?

sage spindleBOT
#

@limber haven

Python help channel opened

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.

scarlet hollow
#

what do you think that .replace(" ", "") is doing?

limber haven
#

stripping the spaces before and after the input

#

so e.g: 42

#

would go to :42

scarlet hollow
#

what makes you think it only removes before/after the part you care about?

limber haven
#

hahahha

#

wow

#

thanks

#

its so litteral

scarlet hollow
#

also use snake_case for variable names

#

!pep8

sage spindleBOT
#
PEP 8

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:

scarlet hollow
limber haven
#

thanks mate. Ill look into it ๐Ÿ™‚

#

I think ill try work it out from here thankyou XD

#

Thankyou for using questionning for me to understand

limber haven
sage spindleBOT
#
Python help channel closed

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.