problems icon indicating copy to clipboard operation
problems copied to clipboard

Einstein check confused by numbers in prompt

Open curiouskiwi opened this issue 1 year ago • 2 comments

If either prompt in the einstein.py code contains digits, check50 will erroneously use those in its comparison of correctness.

Example:

$ python einstein.py
Calculate e=mc^2, using mass: 1
E is: 90000000000000000

check50:

:) einstein.py exists
:( input of 1 yields output of 90000000000000000
    expected "90000000000000...", not "2,"
    Seems like your output might not be the right number!

Notice that it is picking up the following , in the prompt as well. not "2,"

curiouskiwi avatar Aug 10 '23 20:08 curiouskiwi

@patrickthornton Do you think you'd have time to take a look at how we could improve this one?

CarterZenke avatar Aug 10 '23 20:08 CarterZenke

I had the same experience which appears to be caused by the caret (^) in the prompt. When I removed it and changed the prompt to "Enter an integer for mass in E = mc²:" and submitted again, there were no issues.

betapro avatar Aug 23 '23 14:08 betapro