I am quite sure my program is correct, however, the 2nd part of correct answer doesn't show up

I am doing Object Oriented Programming, and I am quite sure the body of the program contains no errors. However, the 2nd part of correct answer contained in the red rectangle, shown below, does NOT show up. Can any experts tell me what went wrong with the body of my program? Thanks.
“New windows vm. state : on
<class ‘main.WindowsVM’>
windows ops”

Please don’t post screenshots.

Copy and paste any code or traceback, and in order to preserve formatting, select the code or traceback that you posted and then click the </> button.

In which dict is it looking up that key, and what are the keys in that dict?

1 Like

Roger. I will strictly follow your rule.

You are obviously not doing that, and are in fact repeatably ignoring this request. At some point, it becomes straight up rude to expect others to help you but to just ignore most of what they are saying. In almost every thread you have posted, you have been asked to stop posting screenshots, and yet you only post screenshots. If you have no interested in following these requests, at least straightup say that instead of always feigning understanding and compliance.

7 Likes

My apology. No more against the rule, I promise.

Compare the string literal that are your dictionary keys on line 17 to the string literal you pass on line 30 (whitespace inside string literals matters)

Sebastian, when you apply Shantanu’s hint, perhaps you will agree that starting and ending string literals with spaces is a bad idea.

PS: when you program does not work, you can be 99+ percent sure that it has errors. Continuing to think otherwise is the enemy of debugging. You will literally not see errors to avoid proving yourself wrong, as you did here.

4 Likes

@GeekSebastian : Don’t be discouraged. In case you missed it in Karl’s post the guide to posting code instead of screenshots is in About the Python Help category. Seems like about half of new posters need this advice.

Other thing: read error messages carefully. They’re not always the most helpful, but they’re always precise.

The “Windows” VM init parameter has extra spaces