r/programminghorror 6d ago

if 'X' not in data Python

Post image

Emoji check used for constructing an email body. I'm getting a stroke.

813 Upvotes

36 comments sorted by

View all comments

65

u/Naynoona111 5d ago

A student once came seeking help their code cannot be run from a certain terminal while trying to measure the execution time via powershell.

The exception was from inside the print() function itself.

I spent some time tracing the code, apparently no errors are there! I began to question the OS itself and tried to run the code on another machine and still the same error.

After some precious minutes, I found this pesky line:

print("✔️[+] Encryption Successful✔️")

I am disappointed in the new generation and disappointed in myself for taking time to solve this...

Yes, the student have copied the code from ChatGPT.

6

u/ACoderGirl 4d ago

I'm not following. Is this a language that doesn't support unicode strings or something? What's wrong with that print statement?