1. Welcome
ACHOO is a programming language where you write programs out of sneezes. Every piece of code, every letter and every symbol is written as a sneeze, or as one of the things people say back to someone who sneezes.
Behind the scenes ACHOO turns your sneezes into Python and runs that. So when you write ACHOO, you are really writing Python in disguise. Anything Python can do, ACHOO can do. If you already know a little Python, you already know what ACHOO programs can say. You only have to learn how to sneeze it.
Wait, is this a joke?
Yes. ACHOO is an esoteric programming language, or esolang for short. Esolangs are languages made for fun, not for getting work done. Some are made to be as hard as possible, some to look silly, and some just to see if an idea can work at all. Nobody builds a real app in one. People write them to make other programmers laugh, groan, or wonder why anyone would do this.
A few famous ones:
- Brainfuck has only 8 commands, each a single symbol like
+or[. ACHOO started out as Brainfuck written in sneezes. - Ook! is Brainfuck rewritten as orangutan noises:
Ook.,Ook?andOok!. - INTERCAL refuses to run your program if you don't say
PLEASEoften enough, and also if you say it too often. That's where thebless yourule comes from. - Chef programs look like cooking recipes, and LOLCODE programs look like internet cat memes.
So ACHOO is a joke, but a working one. Every program in these docs really runs, and it can do anything Python can. It's just a very silly way to do it. If you ever find yourself writing something important in ACHOO, take a tissue and have a little lie down.
These docs start from zero. You don't need to know Python or binary. Every part explains one idea, shows examples and then gives you a short quiz to check you got it. Take your time with the parts about counting o's and binary letters, because those are the bits people find hardest.
Every example on this page was made by the real ACHOO interpreter and checked before it went here, so you can copy them and they will run.
2. Getting ready
There are three ways to run ACHOO. Pick whichever you like.
The website
The ACHOO Interpreter page runs programs right in your browser. Paste or type your sneezes into the box and press Run. Point at any word and a little yellow box tells you what it means, which is very handy while you learn.
As you type, a list pops up under the cursor with the sneezes that fit, and what each one does in small text underneath.
Use the arrow keys to move through it and Enter or Tab to pick one, or tap it on a phone. It works backwards too: type a
Python word like print or a symbol like ( and it suggests the sneeze for it, and type any single letter to
get its spelled sneeze.
The fastest way to spell text is the bracket shortcut: start a word with (, type your text, and finish with
). As soon as you type the closing bracket, everything inside turns into spelled sneezes, so (Hi there)
becomes the binary letters for Hi there, with acho for the space. It doesn't work after sniff, because
comments are normal words.
You can also type a whole line of normal Python, like print("example"), and press space twice. The line
turns into ACHOO. If the line already starts with sneezes, those stay as they are and only the Python after them is
translated. It skips comment lines and the bless you and sorry everyone lines, and it translates one line at
a time, so it doesn't add blessings for you. For whole programs, Convert Python is still the easiest.
Installing it on Windows
Download the ACHOO zip, extract it and double-click install.bat. You need Python 3.10 or newer. After that:
- double-click any
.achfile to run it - right-click in a folder, then New, then ACHOO Program to make a new one
- right-click a
.achfile, then Edit to open it in Notepad - type
achoo yourfile.achin a new terminal window
achoo.py on any computer
On Mac, Linux, or Windows without the installer, run achoo.py with Python:
python3 achoo.py program.ach python3 achoo.py --sneezify program.py > program.ach python3 achoo.py --python program.ach python3 achoo.py --sneezes
The first line runs a program. The second turns a Python file into sneezes. The third shows you the Python hidden inside a sneeze file, which is the best way to check your work. The last one lists every sneeze.
ACHOO files end in .ach. Older files ending in .achoo still work.
3. Your first program
Here is the classic first program. It prints Hello, World! on the screen.
gesundheit achooo achooooooooo achOooOooo achOOooOoO achOOoOOoo achOOoOOoo achOOoOOOO achoooooo acho achOoOoOOO atchoooooo achOOoOOoo achOOooOoo achOooooO achooooooooo achoooo sorry everyone
print("Hello, World!")It looks like nonsense, but every single word means something. Let's take it apart word by word, left to right:
| Word | Kind | How to read it | Means |
|---|---|---|---|
| gesundheit | reply word | reply word | print |
| achooo | world sneeze | achoo group, 3 o's | ( |
| achooooooooo | world sneeze | achoo group, 9 o's | " |
| achOooOooo | spelled letter | binary 1001000 = 72 | H |
| achOOooOoO | spelled letter | binary 1100101 = 101 | e |
| achOOoOOoo | spelled letter | binary 1101100 = 108 | l |
| achOOoOOoo | spelled letter | binary 1101100 = 108 | l |
| achOOoOOOO | spelled letter | binary 1101111 = 111 | o |
| achoooooo | world sneeze | achoo group, 6 o's | , |
| acho | world sneeze | achoo group, 1 o's | a space |
| achOoOoOOO | spelled letter | binary 1010111 = 87 | W |
| atchoooooo | world sneeze | atchoo group, 6 o's | or |
| achOOoOOoo | spelled letter | binary 1101100 = 108 | l |
| achOOooOoo | spelled letter | binary 1100100 = 100 | d |
| achOooooO | spelled letter | binary 100001 = 33 | ! |
| achooooooooo | world sneeze | achoo group, 9 o's | " |
| achoooo | world sneeze | achoo group, 4 o's | ) |
Put all the meanings together and you get print("Hello, World!"). That's the whole trick: each word is one small
piece of the Python code, and they join up with nothing in between.
Notice the three colours. The orange word is a reply word, the green ones are world sneezes and the blue ones are spelled letters. Those are the three kinds of words in ACHOO, and the next three parts explain each of them.
The last line, sorry everyone, isn't code at all. It's manners. Every ACHOO program has to end by
apologising for all that sneezing. You'll learn the manners in parts 8 and 9.
4. Reply words
The code people use most often gets a reply word: something you would say to someone who sneezes. There are 14 of them, and they are the easiest part of ACHOO because you can read them like normal words.
| Reply word | Means | A way to remember it |
|---|---|---|
| gesundheit | print | what you say to someone who sneezes, and print says something too |
| cough | def | a cough comes before a sneeze, and def comes before a function |
| tissue | return | you hand a tissue back |
| salud | if | Spanish for bless you, used for the most common question in code |
| sante | else | French, its partner |
| salute | elif | Italian, sits between the two |
| zdrowie | for | Polish for bless you, used for repeating things |
| prosit | while | German toast, also for repeating things |
| hanky | self | the hanky that belongs to the object itself |
| sniffle | import | you sniffle when you catch something from elsewhere |
| fever | class | a fever is a whole category of sick |
| healthy | True | healthy is true |
| sick | False | sick is false |
| snot | None | snot is nothing useful |
Reply words are always written in small letters, exactly as shown. Gesundheit with a capital G is not a reply word
and will crash your program.
Here is a tiny program that only needs reply words and a few sneezes. It prints True, because healthy means True:
gesundheit achooo healthy achoooo sorry everyone
print(True)
5. World sneezes
Everything else that's common in code, like brackets, the equals sign, colons and words like and or range,
is a world sneeze. ACHOO uses 8 ways people around the world write a sneeze:
achoo, atchoo, ahchoo, hachoo, hatchoo, aitchoo, atishoo, kerchoo
Each spelling is a group, and each group holds up to 9 pieces of code. To read a world sneeze you need two things:
- Which group is it? Look at the letters before the o's.
achis the achoo group,hatchis the hatchoo group, and so on. - How many o's are there? Count them. That number picks the piece of code inside the group.
For example, achooo is the achoo group with 3 o's, which is (. And hatchoooooooo is the hatchoo group with
8 o's, which is ==.
Tips for counting o's
- Count in threes.
ooo ooo oois 3 + 3 + 2 = 8, much easier than counting one by one. - On the website, point at the sneeze and the tooltip counts for you.
- There are never more than 9 o's in a world sneeze. If you count 10 or more, something's wrong, and the
interpreter will say so:
nobody sneezes that hard. - The two most common sneezes are short on purpose:
acho(1 o) is a space andachoo(2 o's) is 4 spaces, which is how you indent code.
Every world sneeze
Here they all are, group by group. You don't need to learn them by heart. Keep this page open while you write, or use the sneeze table on the website.
The achoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | acho | a space |
| 2 | achoo | 4 spaces |
| 3 | achooo | ( |
| 4 | achoooo | ) |
| 5 | achooooo | . |
| 6 | achoooooo | , |
| 7 | achooooooo | : |
| 8 | achoooooooo | = |
| 9 | achooooooooo | " |
The atchoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | atcho | ' |
| 2 | atchoo | in |
| 3 | atchooo | from |
| 4 | atchoooo | __init__ |
| 5 | atchooooo | and |
| 6 | atchoooooo | or |
| 7 | atchooooooo | not |
| 8 | atchoooooooo | is |
| 9 | atchooooooooo | try |
The ahchoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | ahcho | except |
| 2 | ahchoo | finally |
| 3 | ahchooo | with |
| 4 | ahchoooo | as |
| 5 | ahchooooo | lambda |
| 6 | ahchoooooo | yield |
| 7 | ahchooooooo | pass |
| 8 | ahchoooooooo | break |
| 9 | ahchooooooooo | continue |
The hachoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | hacho | raise |
| 2 | hachoo | global |
| 3 | hachooo | nonlocal |
| 4 | hachoooo | del |
| 5 | hachooooo | assert |
| 6 | hachoooooo | async |
| 7 | hachooooooo | await |
| 8 | hachoooooooo | [ |
| 9 | hachooooooooo | ] |
The hatchoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | hatcho | { |
| 2 | hatchoo | } |
| 3 | hatchooo | + |
| 4 | hatchoooo | - |
| 5 | hatchooooo | * |
| 6 | hatchoooooo | / |
| 7 | hatchooooooo | % |
| 8 | hatchoooooooo | == |
| 9 | hatchooooooooo | != |
The aitchoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | aitcho | < |
| 2 | aitchoo | > |
| 3 | aitchooo | <= |
| 4 | aitchoooo | >= |
| 5 | aitchooooo | += |
| 6 | aitchoooooo | -= |
| 7 | aitchooooooo | -> |
| 8 | aitchoooooooo | ** |
| 9 | aitchooooooooo | // |
The atishoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | atisho | # |
| 2 | atishoo | @ |
| 3 | atishooo | _ |
| 4 | atishoooo | __name__ |
| 5 | atishooooo | __main__ |
| 6 | atishoooooo | range |
| 7 | atishooooooo | len |
| 8 | atishoooooooo | input |
| 9 | atishooooooooo | str |
The kerchoo group
| o's | Sneeze | Means |
|---|---|---|
| 1 | kercho | int |
| 2 | kerchoo | \ |
| 3 | kerchooo | match |
| 4 | kerchoooo | case |
| 5 | kerchooooo | f |
6. Spelled letters
Names you make up, numbers and the text inside quotes are spelled out one character at a time. These words always start
with ach and then use a mix of small o's and capital O's. The capital O's are what tell ACHOO it's a letter
and not a world sneeze.
The o's and O's are a number written in binary: small o means 0 and capital O means 1. That number
is the character's code, the number every computer uses for that letter.
Binary in two minutes
Normal numbers use ten digits, 0 to 9. Binary only uses two: 0 and 1. Each position in a binary number is worth double the one to its right. For a 7-digit binary number, the positions are worth:
| Position | 1st | 2nd | 3rd | 4th | 5th | 6th | 7th |
|---|---|---|---|---|---|---|---|
| Worth | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To read a binary number, add up the positions that have a 1. For example 1001000: the 1st position (64) and the 4th position (8)
are 1, so it's 64 + 8 = 72. Character 72 is the capital letter H.
Reading a spelled letter
Take achOooOooo:
- Drop the
achat the start:OooOooo - Swap o for 0 and O for 1:
1001000 - Add up the positions: 64 + 8 = 72
- Look up character 72 in the tables below:
H
Writing a spelled letter
Going the other way, to spell the letter e:
- Find its character code in the tables below: 101
- Make it out of 64, 32, 16, 8, 4, 2 and 1: 101 = 64 + 32 + 4 + 1
- Write a 1 for each position you used and 0 for the rest:
1100101 - Swap 1 for O and 0 for o, and put
achin front:achOOooOoO
Two handy facts: a lowercase letter's code is always 32 more than its capital (H is 72, h is 104), and spelled letters always
start with a capital O, because the first position is always a 1. If one starts with a small o, the interpreter complains
that it starts weakly.
Numbers are spelled too
The number 42 is the character 4 followed by the character 2, so it's two spelled letters:
achOOoOoo achOOooOo. Don't spell the number 42 itself in binary. Spell its digits.
Letter tables
Lowercase letters
| Letter | Code | Binary | Sneeze |
|---|---|---|---|
a | 97 | 1100001 | achOOooooO |
b | 98 | 1100010 | achOOoooOo |
c | 99 | 1100011 | achOOoooOO |
d | 100 | 1100100 | achOOooOoo |
e | 101 | 1100101 | achOOooOoO |
f | 102 | 1100110 | achOOooOOo |
g | 103 | 1100111 | achOOooOOO |
h | 104 | 1101000 | achOOoOooo |
i | 105 | 1101001 | achOOoOooO |
j | 106 | 1101010 | achOOoOoOo |
k | 107 | 1101011 | achOOoOoOO |
l | 108 | 1101100 | achOOoOOoo |
m | 109 | 1101101 | achOOoOOoO |
n | 110 | 1101110 | achOOoOOOo |
o | 111 | 1101111 | achOOoOOOO |
p | 112 | 1110000 | achOOOoooo |
q | 113 | 1110001 | achOOOoooO |
r | 114 | 1110010 | achOOOooOo |
s | 115 | 1110011 | achOOOooOO |
t | 116 | 1110100 | achOOOoOoo |
u | 117 | 1110101 | achOOOoOoO |
v | 118 | 1110110 | achOOOoOOo |
w | 119 | 1110111 | achOOOoOOO |
x | 120 | 1111000 | achOOOOooo |
y | 121 | 1111001 | achOOOOooO |
z | 122 | 1111010 | achOOOOoOo |
Capital letters
| Letter | Code | Binary | Sneeze |
|---|---|---|---|
A | 65 | 1000001 | achOoooooO |
B | 66 | 1000010 | achOooooOo |
C | 67 | 1000011 | achOooooOO |
D | 68 | 1000100 | achOoooOoo |
E | 69 | 1000101 | achOoooOoO |
F | 70 | 1000110 | achOoooOOo |
G | 71 | 1000111 | achOoooOOO |
H | 72 | 1001000 | achOooOooo |
I | 73 | 1001001 | achOooOooO |
J | 74 | 1001010 | achOooOoOo |
K | 75 | 1001011 | achOooOoOO |
L | 76 | 1001100 | achOooOOoo |
M | 77 | 1001101 | achOooOOoO |
N | 78 | 1001110 | achOooOOOo |
O | 79 | 1001111 | achOooOOOO |
P | 80 | 1010000 | achOoOoooo |
Q | 81 | 1010001 | achOoOoooO |
R | 82 | 1010010 | achOoOooOo |
S | 83 | 1010011 | achOoOooOO |
T | 84 | 1010100 | achOoOoOoo |
U | 85 | 1010101 | achOoOoOoO |
V | 86 | 1010110 | achOoOoOOo |
W | 87 | 1010111 | achOoOoOOO |
X | 88 | 1011000 | achOoOOooo |
Y | 89 | 1011001 | achOoOOooO |
Z | 90 | 1011010 | achOoOOoOo |
Digits
| Digit | Code | Binary | Sneeze |
|---|---|---|---|
0 | 48 | 110000 | achOOoooo |
1 | 49 | 110001 | achOOoooO |
2 | 50 | 110010 | achOOooOo |
3 | 51 | 110011 | achOOooOO |
4 | 52 | 110100 | achOOoOoo |
5 | 53 | 110101 | achOOoOoO |
6 | 54 | 110110 | achOOoOOo |
7 | 55 | 110111 | achOOoOOO |
8 | 56 | 111000 | achOOOooo |
9 | 57 | 111001 | achOOOooO |
Other symbols you might need
| Symbol | Code | Binary | Sneeze |
|---|---|---|---|
! | 33 | 100001 | achOooooO |
? | 63 | 111111 | achOOOOOO |
$ | 36 | 100100 | achOooOoo |
& | 38 | 100110 | achOooOOo |
; | 59 | 111011 | achOOOoOO |
^ | 94 | 1011110 | achOoOOOOo |
| | 124 | 1111100 | achOOOOOoo |
~ | 126 | 1111110 | achOOOOOOo |
` | 96 | 1100000 | achOOooooo |
Symbols like ( or = also have spelled versions, but you'll normally use their world sneezes instead because they are shorter.
7. How lines work
An ACHOO file is made of lines, and each line of sneezes becomes exactly one line of Python. Line 5 of your sneezes is line 5 of the Python, which also means error messages point at the right line.
Spaces between words don't count
The spaces you type between sneezes are only there to separate the words. They don't end up in the code. When you
want a real space in your code, like between print and something else, or inside text, you sneeze it: acho.
Indentation is a sneeze too
Python uses indentation to show which lines belong inside an if, a loop or a function. In ACHOO you write that
indentation with sneezes at the start of the line: achoo is 4 spaces, and two of them is 8 spaces. You can put normal
spaces at the start of an ACHOO line to make it look nice, but they are ignored. Only the sneezes count.
zdrowie acho achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo acho atchoo acho atishoooooo achooo achOOooOO achoooo achooooooo achoo gesundheit achooo achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo achoooo sorry everyone
for number in range(3):
print(number)The second line starts with achoo, which puts print(number) inside the loop.
You can always spell things out
Every reply word and world sneeze is a shortcut. You could spell print letter by letter instead of writing
gesundheit, and it would work exactly the same. The converter always picks the shortest way, so it uses the shortcut.
Empty lines
Empty lines are fine anywhere and do nothing, just like in Python.
8. bless you and the 7 statements rule
This is the rule people get stuck on most, so this part goes slowly.
ACHOO is a polite interpreter. After it has read 7 statements, it wants a line that says bless you
before it reads any more. If it doesn't get one, the program crashes. If you say it too early, it also crashes.
What exactly is a statement?
A statement is one line of code that actually does something. In practice, count the lines of your program, but skip a few kinds of lines. Here are the exact rules, all tested on the real interpreter:
| Line | Counts? |
|---|---|
A normal line of code, like x = 5 or print("hi") | Yes, 1 |
An if, elif, else, for, while, def or class line (the one ending with a colon) | Yes, 1 |
Each line inside an if, loop or function | Yes, 1 each |
A decorator line like @property | Yes, 1 |
| An empty line | No |
A comment line (sniff in ACHOO, # in Python) | No |
| A statement split over several lines, like a long list with one item per line | Yes, but only once, on the line where it starts |
Two statements on one line with a semicolon, like a = 1; b = 2 | Yes, but only once |
A short if on one line, like if ready: go() | Yes, but only once |
The bless you line itself | No, it resets the count to 0 |
The sorry everyone line | No |
Counting example 1
Here is a short Python program with its count next to each line. A dash means the line doesn't count.
| Count | Python line |
|---|---|
| 1 | age = 12 |
| 2 | if age > 10: |
| 3 | print("big") |
| 4 | print("really big") |
| 5 | else: |
| 6 | print("small") |
| - | |
| - | # done checking |
| 7 | print("bye") |
That's 7 statements, so this program needs no blessing at all. If you added one more line of code at the end, it would be
statement 8, and you would need a bless you line just before it.
Counting example 2
| Count | Python line |
|---|---|
| 1 | names = [ |
"Ada", | |
"Bo", | |
] | |
| 2 | total = 0 |
| 3 | total += 1; total += 2 |
| 4 | print(names, total) |
The list starts on line 1 and carries on until the ], but it's all one statement, so it only counts once.
Line 6 has two statements joined by a semicolon, and that also only counts once.
Where the blessing goes
The blessing goes after statement 7 and before statement 8. Then the count starts again from 0, so the next blessing goes after statement 14 and before 15, and so on. Here are 8 statements with the blessing in the right place:
achOOOOooo achOOoooO acho achoooooooo acho achOOoooO achOOOOooo achOOooOo acho achoooooooo acho achOOooOo achOOOOooo achOOooOO acho achoooooooo acho achOOooOO achOOOOooo achOOoOoo acho achoooooooo acho achOOoOoo achOOOOooo achOOoOoO acho achoooooooo acho achOOoOoO achOOOOooo achOOoOOo acho achoooooooo acho achOOoOOo achOOOOooo achOOoOOO acho achoooooooo acho achOOoOOO bless you achOOOOooo achOOOooo acho achoooooooo acho achOOOooo sorry everyone
Some details:
- The blessing line must say only
bless you, on its own line. Capital letters don't matter, soBless Youalso works. - Indentation doesn't matter for the blessing. It can be at the start of the line even inside a loop, because it isn't code.
- If your program has exactly 7 statements and you put a blessing after them, that's fine too.
- A blessing after only 3, 5 or 6 statements is too early, and the program crashes.
- Blank lines and comments between your statements don't change the count.
What the errors look like
If you forget the blessing:
SneezeError: program.ach, line 8: nobody blessed me (put a "bless you" line before this one)
If you bless too early:
SneezeError: program.ach, line 4: blessed too early, only 3 statement(s) since the last "bless you"
Both messages tell you the line number, so you know exactly where to look.
The easy way
Counting by hand gets tiring in long programs. If you write your program in Python and convert it, either with
Convert Python on the website or python3 achoo.py --sneezify, the converter counts for you and puts every
bless you in exactly the right place.
9. sorry everyone
The last line of every ACHOO program has to be sorry everyone. It apologises for all the sneezing, and the program
won't run without it:
SneezeError: program.ach: you sneezed on everyone and never apologised (the last line must be "sorry everyone")
- It has to be the last line that isn't empty. Empty lines after it are fine.
- Capital letters don't matter:
Sorry Everyoneworks too. - It's manners, not code, so it isn't a statement and doesn't count towards the 7.
10. Comments with sniff
A comment is a note for people reading the code. The computer ignores it. In ACHOO, a comment starts with the word
sniff. Everything after it on that line can be normal words, and ACHOO skips it.
sniff count to three zdrowie acho achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo acho atchoo acho atishoooooo achooo achOOooOO achoooo achooooooo sniff 0, 1 and 2 achoo gesundheit achooo achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo achoooo sorry everyone
# count to three
for number in range(3): # 0, 1 and 2
print(number)- A comment can take a whole line, or go at the end of a line after the code.
- Comments aren't statements, so they don't count towards the 7.
- When you convert Python, its
#comments becomesniffcomments. A#inside text, like"#1 fan", stays text.
11. Writing real programs
Now you know all the pieces. This part shows the things you'll write most often. Each one shows ACHOO first and then the same thing in Python, so you can match them up. Point at the words on the website to decode them as you go.
Variables
A variable is a name that holds a value. The name is spelled with letters, then acho achoooooooo acho for
= , then the value.
achOOOooOO achOOoooOO atchoooooo achOOooOoO acho achoooooooo acho achOOoooO achOOoooo gesundheit achooo achOOOooOO achOOoooOO atchoooooo achOOooOoO achoooo sorry everyone
score = 10 print(score)
Text
Text goes inside quotes. achooooooooo is a double quote and atcho is a single quote. Everything between the quotes is
spelled letter by letter, including spaces.
achOOoOOOo achOOooooO achOOoOOoO achOOooOoO acho achoooooooo acho achooooooooo achOoooooO achOOooOoo achOOooooO achooooooooo gesundheit achooo achooooooooo achOooOooo achOOoOooO acho achooooooooo acho hatchooo acho achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achoooo sorry everyone
name = "Ada"
print("Hi " + name)Maths
The maths symbols all have world sneezes: hatchooo is +, hatchoooo is -, hatchooooo is *,
hatchoooooo is /, hatchooooooo is % (the remainder), aitchoooooooo is ** (power) and aitchooooooooo is // (divide and round down).
achOOOoOoo achOOoOOOO achOOOoOoo achOOooooO achOOoOOoo acho achoooooooo acho achOOoOOo acho hatchooooo acho achOOoOOO gesundheit achooo achOOOoOoo achOOoOOOO achOOOoOoo achOOooooO achOOoOOoo achoooo sorry everyone
total = 6 * 7 print(total)
Asking the user
atishoooooooo is input. It waits for the user to type something. Whatever they type comes back as text.
achOOoOOOo achOOooooO achOOoOOoO achOOooOoO acho achoooooooo acho atishoooooooo achooo achooooooooo achOoOOooO achOOoOOOO achOOOoOoO achOOOooOo acho achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achOOOOOO acho achooooooooo achoooo gesundheit achooo achooooooooo achOooooOo achOOoOOoo achOOooOoO achOOOooOO achOOOooOO acho achOOOOooO achOOoOOOO achOOOoOoO achoooooo acho achooooooooo acho hatchooo acho achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achoooo sorry everyone
name = input("Your name? ")
print("Bless you, " + name)Making choices with if
salud is if, salute is elif and sante is else. Don't forget the colon achooooooo at the end of each of those
lines, and the indent achoo on the lines inside.
achOOOoOoo achOOooOoO achOOoOOoO achOOOoooo achOOooOoO achOOOooOo achOOooooO achOOOoOoo achOOOoOoO achOOOooOo achOOooOoO acho achoooooooo acho achOOooOO achOOOooO salud acho achOOOoOoo achOOooOoO achOOoOOoO achOOOoooo achOOooOoO achOOOooOo achOOooooO achOOOoOoo achOOOoOoO achOOOooOo achOOooOoO acho aitchoo acho achOOooOO achOOOooo achooooooo achoo gesundheit achooo achooooooooo kerchooooo achOOooOoO achOOOoOOo achOOooOoO achOOOooOo achooooooooo achoooo salute acho achOOOoOoo achOOooOoO achOOoOOoO achOOOoooo achOOooOoO achOOOooOo achOOooooO achOOOoOoo achOOOoOoO achOOOooOo achOOooOoO acho aitchoo acho achOOooOO achOOoOOO achooooooo achoo gesundheit achooo achooooooooo achOOOoOOO achOOooooO achOOOooOo achOOoOOoO achooooooooo achoooo sante achooooooo achoo gesundheit achooo achooooooooo achOOoOooo achOOooOoO achOOooooO achOOoOOoo achOOOoOoo achOOoOooo achOOOOooO achooooooooo achoooo sorry everyone
temperature = 39
if temperature > 38:
print("fever")
elif temperature > 37:
print("warm")
else:
print("healthy")Comparisons: hatchoooooooo is equal, hatchooooooooo is not equal, aitcho and aitchoo are less and more, aitchooo and aitchoooo
are less-or-equal and more-or-equal. atchooooo, atchoooooo and atchooooooo combine them.
Repeating with for and while
zdrowie repeats something for every item. atchoo is in, and atishoooooo is range, which gives you numbers.
zdrowie acho achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO acho atchoo acho atishoooooo achooo achOOoooO achoooooo acho achOOoOoo achoooo achooooooo achoo gesundheit achooo achooooooooo achOOooooO achOOoooOO achOOoOooo achOOoOOOO achOOoOOOO acho achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo achooooooooo achoooooo acho achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achoooo sorry everyone
for sneeze in range(1, 4):
print("achoo number", sneeze)prosit repeats as long as something is true:
achOOOoOoo atchoooooooo achOOOooOO achOOOoOoO achOOooOoO achOOOooOO acho achoooooooo acho achOOooOO prosit acho achOOOoOoo atchoooooooo achOOOooOO achOOOoOoO achOOooOoO achOOOooOO acho aitchoo acho achOOoooo achooooooo achoo gesundheit achooo achOOOoOoo atchoooooooo achOOOooOO achOOOoOoO achOOooOoO achOOOooOO achoooooo acho achooooooooo achOOOoOoo atchoooooooo achOOOooOO achOOOoOoO achOOooOoO achOOOooOO acho achOOoOOoo achOOooOoO kerchooooo achOOOoOoo achooooooooo achoooo achoo achOOOoOoo atchoooooooo achOOOooOO achOOOoOoO achOOooOoO achOOOooOO acho aitchoooooo acho achOOoooO sorry everyone
tissues = 3
while tissues > 0:
print(tissues, "tissues left")
tissues -= 1Functions
cough makes a function and tissue hands back its answer.
cough acho achOOooOoo achOOoOOOO achOOOoOoO achOOoooOo achOOoOOoo achOOooOoO achooo achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo achoooo achooooooo achoo tissue acho achOOoOOOo achOOOoOoO achOOoOOoO achOOoooOo achOOooOoO achOOOooOo acho hatchooooo acho achOOooOo gesundheit achooo achOOooOoo achOOoOOOO achOOOoOoO achOOoooOo achOOoOOoo achOOooOoO achooo achOOooOo achOOoooO achoooo achoooo sorry everyone
def double(number):
return number * 2
print(double(21))Lists
hachoooooooo and hachooooooooo are square brackets. achoooooo is a comma.
achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO acho achoooooooo acho hachoooooooo achooooooooo achOOooooO achOOoooOO achOOoOooo achOOoOOOO achOOoOOOO achooooooooo achoooooo acho achooooooooo achOOooooO achOOOoOoo atchoooooooo achOOoOooo achOOoOOOO achOOoOOOO achooooooooo achoooooo acho achooooooooo achOOoOoOO achOOooOoO achOOOooOo achOOoooOO achOOoOooo achOOoOOOO achOOoOOOO achooooooooo hachooooooooo zdrowie acho achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO acho atchoo acho achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO achooooooo achoo gesundheit achooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achoooo gesundheit achooo atishooooooo achooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO achoooo achoooo sorry everyone
sneezes = ["achoo", "atishoo", "kerchoo"]
for sneeze in sneezes:
print(sneeze)
print(len(sneezes))Classes
fever makes a class, hanky is self and atchoooo is __init__.
fever acho achOoOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo achooooooo achoo cough acho atchoooo achooo hanky achoooooo acho achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achoooo achooooooo achoo achoo hanky achooooo achOOoOOOo achOOooooO achOOoOOoO achOOooOoO acho achoooooooo acho achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achoo achoo hanky achooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO acho achoooooooo acho achOOoooo achoo cough acho achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achooo hanky achoooo achooooooo achoo achoo hanky achooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO acho aitchooooo acho achOOoooO achoo achoo gesundheit achooo hanky achooooo achOOoOOOo achOOooooO achOOoOOoO achOOooOoO achoooooo acho achooooooooo achOOOooOO achOOooooO achOOOOooO achOOOooOO acho achOOooooO achOOoooOO achOOoOooo achOOoOOOO achOOoOOOO achooooooooo achoooo bless you achOOOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo acho achoooooooo acho achOoOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo achooo achooooooooo achOoooooO achOOooOoo achOOooooO achooooooooo achoooo achOOOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo achooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achooo achoooo achOOOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo achooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achooo achoooo gesundheit achooo achOOOoooo achOOooooO achOOOoOoo achOOoOooO achOOooOoO achOOoOOOo achOOOoOoo achooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO achoooooo acho achooooooooo achOOOooOO achOOoOOOo achOOooOoO achOOooOoO achOOOOoOo achOOooOoO achOOOooOO achooooooooo achoooo sorry everyone
class Patient:
def __init__(self, name):
self.name = name
self.sneezes = 0
def sneeze(self):
self.sneezes += 1
print(self.name, "says achoo")
patient = Patient("Ada")
patient.sneeze()
patient.sneeze()
print(patient.sneezes, "sneezes")That program has 11 statements, so it needs one bless you, between statement 7 (print(self.name, "says achoo"))
and statement 8 (patient = Patient("Ada")). Find it in the sneezes above and count for yourself. Remember that the
empty lines don't count.
Using Python's modules
sniffle is import and atchooo is from. Everything in Python's standard library works.
sniffle acho achOOOooOo atchooooo achOOoOOOO achOOoOOoO gesundheit achooo achOOOooOo atchooooo achOOoOOOO achOOoOOoO achooooo achOOoooOO achOOoOooo achOOoOOOO achOOoOooO achOOoooOO achOOooOoO achooo hachoooooooo achooooooooo achOOooooO achOOoooOO achOOoOooo achOOoOOOO achOOoOOOO achooooooooo achoooooo acho achooooooooo achOOooooO achOOOoOoo atchoooooooo achOOoOooo achOOoOOOO achOOoOOOO achooooooooo hachooooooooo achoooo achoooo sorry everyone
import random print(random.choice(["achoo", "atishoo"]))
12. The easy way to write ACHOO
Real ACHOO programmers almost never sneeze by hand. Here's how most ACHOO gets written:
- Write the program in Python.
- Convert it, with Convert Python on the website or
python3 achoo.py --sneezify program.py > program.ach. - The converter adds every
bless youand thesorry everyonefor you, and keeps your comments assniffcomments. - Run it.
To read sneezes, use the Debug button on the website or python3 achoo.py --python program.ach. Both show the Python
hiding inside. Pointing at words on the website shows what each one means.
Hand-writing is still fun for small things, and it's the best way to really learn the sneezes. Start by changing the text in Hello World, then try adding a second line.
13. Error messages
When ACHOO is unhappy, it tells you with a SneezeError and the line number. Here's every one and how to fix it:
| Message | What it means | How to fix it |
|---|---|---|
program.ach, line 1: 'hello' is not a sneeze | A word that isn't a sneeze, a reply word or one of the manners | Check the spelling. Reply words are lowercase. Normal words are only allowed after sniff. |
program.ach, line 1: 12 o's? nobody sneezes that hard | A world sneeze with more than 9 o's | Count the o's again. World sneezes go up to 9. |
program.ach, line 1: 'kerchoooooo' doesn't mean anything yet | A real sneeze spelling, but nothing is stored at that count yet | Check the count against the tables in part 5. |
program.ach, line 1: 'achoO' starts weakly. spelled sneezes start with a capital O | A spelled letter that starts with a small o | Spelled letters always start with ach then a capital O. |
nobody blessed me | 8 statements in a row without bless you | Put bless you before the line it names. |
blessed too early | bless you after fewer than 7 statements | Move it down, or remove it. |
never apologised | The last line isn't sorry everyone | Add sorry everyone as the last line. |
that file isn't a tissue. use .ach | The file doesn't end in .ach | Rename it to end in .ach. |
Your program caught a TypeError. achoo. | The sneezes were fine, but the Python inside them has a problem | Use Debug or --python to see the Python, then fix it like normal Python. |
14. Final quiz
One last check. If you get these right, you can write ACHOO.