# What question is my computer asking me?

I need your help. I think my computer is gaining sentience. I went to a play, but when I got back this file was saved on my desktop:

#!/usr/bin/env python3
# -*- coding: latin8 -*-
i = input("Please enter a character: ")
print((i == "Ä" or i == ";"))


(note: The original riddle had a colon : instead of a semicolon ;. This was my fault, the correct character is a semicolon)

It was saved as question.py. I know I didn't write this! I think my computer is trying to ask me a question, but I can't tell what the question is.

What question is my computer asking me?

To avoid confusing people, this is not a unicode trick. The "Ä" character is encoded as a single byte, 0xC4.

Hint:

The question is a famous line

• Well, technically, it's asking you to 'Please enter a character'. I think you're looking for something less obvious though. – Tim Couwelier May 19 '16 at 5:54
• @BaSzAt Yes, it actually is saved in Latin8, and that is important and relevant. – DJMcMayhem May 19 '16 at 8:22
• en.m.wikipedia.org/wiki/ISO/IEC_8859-14 link to the codepahe – Robert Fraser May 19 '16 at 10:27
• Those are characters 0xC4 and 0x3A in the Latin-8 encoding. (In particular, they are regrettably not 0x2B and ~0x2B.) In decimal, 196 and 58. – Gareth McCaughan May 19 '16 at 10:40
• "Give me plastic explosives or give me emergency roadside service" – question_asker May 19 '16 at 11:53

Just a guess:

Could your computer be asking the question: "To be or not to be?" from Shakespeare's Hamlet? My reasoning was simmilar to Caelan's, except I expected to get the Hex value 0x2B from ord('Ä'), but it was giving me 196 (0xC4), and I didn't think to divide by two. If I did so, I would have found that the unicode encoding was 'b', chr(196/2) == 'b', but I just didn't have time to think through my answer, and posted this guess on a hunch. However, looking back If you take unichr(59) which is the ~ (binary NOT) operation of the hex value '0xc4' (~196 is negative).

• Interesting, this might be it, but please explain your thoughts. – fffred May 19 '16 at 10:10
• 2B is '+' and ~2B is is 'Ô' – Robert Fraser May 19 '16 at 10:21
• Great guess. What's your reasoning? – DJMcMayhem May 19 '16 at 13:03
• You got this first therefore are getting my upvote, if you had added an explanation this would have been accepted for sure – Gordon Allocman May 19 '16 at 15:09
• @Caelan Updated answer with reasoning, includes reasoning for ";" as well. – micsthepick May 19 '16 at 21:17

To be or not to be? (Well, more "2b or not 2b")

My reasoning:

The unicode code for Ä is U+00C4. The key part here is C4.
If we translate C4 from hexadecimal to decimal, we get the number 196. Half of 196 is 98.
Let's now translate 98 from decimal to hexadecimal to get 62, and look for unicode code U+0062.
The letter that comes out is b. Note that 196 being 2 times 98 is where the two comes from. Whatever you do for the colon, you will come to something that is not 2b.

• Your last line makes no sense though because anything you type will be 'not' (answer) but only a colon is accepted as 'true' – SlashmanX May 19 '16 at 14:30
• Your reasoning for the first part makes sense though, whether it's right or not, good stuff – SlashmanX May 19 '16 at 14:35
• You're trying to make your explanation adapt to an answer, while it should be vice versa. – Aiman Al-Eryani May 19 '16 at 14:42
• but the semicolon is 59, which is ~196 - it's not just that 3B is "not 2B" – question_asker May 19 '16 at 15:19
• @DJMcMayhem Unaccept my answer and instead accept micsthepick answer instead. It is more complete than mine. – Klyzx May 20 '16 at 13:06

Your computer is developing emotions. The question is 'Do you love me?', and it is offering two choices; A (grade A YES) or a colon (taken to be NO)

• I think a colon is yes (or True) – Mohit Jain May 19 '16 at 8:42
• @MohitJain; OP has changed the Q since my answer - i was using the medical colon as a metaphor – JMP May 19 '16 at 8:59
• Still the output of the program is same. True of a : – Mohit Jain May 19 '16 at 9:53
• @MohitJain; yes so you are only allowed to enter A or : or the computer will see your response as a lie - they are only binary creatures after all – JMP May 19 '16 at 9:55
• Yes, makes sense. – Mohit Jain May 19 '16 at 10:02