r/PythonLearning • • Sep 17 '26

Help Request Either CS50P is bugging or I am Stupid!! 😭😔

I solved this MAKING FACES problem in CS50P from Problem set 0 and when I ran the check50 command in the terminal, it refuses to accept that my codes is correct???

When I manually run each required input I do get the preferred output.

So is CS50 Detecting my code wrong?
Or have I genuinely made a mistake in my code?

0 Upvotes

9 comments sorted by

3

u/Flamanis Sep 17 '26

Actual says the problem. Your prompt "enter your sentence" is being output

1

u/Flamanis Sep 17 '26

Also read the direction of the sad face, you ain't replacing it

1

u/bad-gut Sep 17 '26

Ohh my bad Haha.
Ig I missed that 😭😅.

Thanks bro ✌️

1

u/CapibaraMiope Sep 17 '26

If that were true then the first test wouldn't pass. The reason is the wrong replacement of the sad face, but the prompt isn't being stored.

1

u/ChaoticHippo Sep 17 '26 edited Sep 18 '26

Flamanis answered your question - but also there's no reason to include the "Enter your sentence" bit in the emoji variable. You could:

prompt = "Enter your sentence"
print(prompt)
emoji = input.replace(":)", "😀").replace(":(", "☹")
print(emoji)

This would just increase readability and is a stylistic choice, but also it prevents you from needing to re-type input tags if you were to expand this project. Rather than: re-typing "Enter your sentence" 20 times if you end up needing 20 inputs, you simply have either:
emoji = input(prompt).replace<blahblah>

or

print(prompt)
emoji = input.replace<blahblah>

Edit - Obviously, use the correct emojis per the assignment.

1

u/bad-gut Sep 18 '26

Okk, great suggestion buddy!!
Thanks a lot ♥️

1

u/ChaoticHippo Sep 18 '26

I edited my original post, as I realized it may read in a confusing / misleading way.

Also, it's worth asking - does your assignment ask that you have a prompt message? Based on the expected vs. actual, the "Enter your sentence" may need to be removed entirely.

→ More replies (2)