Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Issue? #49

Open
datalenk opened this issue Oct 26, 2020 · 3 comments
Open

Possible Issue? #49

datalenk opened this issue Oct 26, 2020 · 3 comments

Comments

@datalenk
Copy link

Hello, I'm going through the Python Basic book and going through the excersises and I've come across a possible code error in the PDF page 85, question 5. The solutions to exercises shows the solution, but when entered it doesn't show as True as the instructions says. I've already tried the solution on both Python 2 and Python 3 and no luck. Can someone, please advise?

Github: ch04-strings-and-string-methods/3-manipulate-strings-with-methods.py
Python Basic book PDF: Pg: 85, Question 5

sc1

sc2

sc3

@pratik-choudhari
Copy link

@datalenk you'll have to use .strip() and .lower()

@ghost
Copy link

ghost commented May 11, 2021

Use lower for tge 1st and tge 3rd one.
And use lower and strip for the 4th one.
Which will give you the true answer for all the strings.

@dreamssss04
Copy link

string1="Becoomes"
string2="becomes"
string3="BEAR"
string4=" bEautiful"
print(string1.lower().startswith("be"))
print(string2.startswith("be"))
print(string3.lower().startswith("be"))
print(string4.lower().strip().startswith("be"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants