Stuck on #cz2 program is producing an empty output

remote: [tester::#CZ2] Running tests for Stage #CZ2 (Handle invalid commands)
remote: [tester::#CZ2] Running ./your_program.sh
remote: [your-program] $ invalid_blueberry_command
remote: [tester::#CZ2] Output does not match expected value.
remote: [tester::#CZ2] Expected: “invalid_blueberry_command: command not found”
remote: [tester::#CZ2] Received: “”
remote: [tester::#CZ2] Assertion failed.
remote: [tester::#CZ2] Test failed (try setting ‘debug: true’ in your codecrafters.yml to see more details)

@getitneha, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

this is the code i used to run on my shell prompt
git add .
git commit --allow-empty -m “[any message]”
git push origin master

and my python code is
import sys

def main():
sys.stdout.write(“$ “)
# Simulate input for testing purposes (this would be replaced by actual input in the Codecrafters environment)
command = input().strip() # Strip any extra spaces or newlines
if command:
print(f”{command}: command not found”)
else:
print(“No command entered”)

if name == “main”:
main()

@getitneha The code you pasted above differs from the version submitted to our system. Could you double-check if you’ve saved and committed the latest changes?

Feel free to upload your code to GitHub to inspect the version you submitted to our server and verify the differences.

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.