needmoreeasy EN 한국어
Learn

NME syntax list

Every spelling NME actually accepts, in one place. For explanations, read the language reference; this file is a table, not a tour.

It is generated from the compiler source (python scripts/build-syntax-reference.py), and a check fails the build if the compiler accepts a spelling that is missing here — so the list cannot drift away from the implementation.

How to read this

  • Three levels. Sentence needs no quotes, commas, parentheses, equals signs or colons; beginner is short and exact; advanced is ordinary Python. They mix freely in one file and on one line, with nothing to declare.
  • Python wins. If a line is valid Python, NME leaves it alone. That is why a one-word line (skip, 멈춰) stays a Python name and only becomes an NME command inside a loop block.
  • One NME statement is one Python line. The line count never changes, so a traceback points at the line you actually wrote.
  • The Python produced column is exactly what the compiler emits.

1. Output

LevelNMEPython produced
Sentenceshow Hello world!print("Hello world!")
SentenceHello world showprint("Hello world")
SentenceHello everyone!print("Hello everyone!")
Sentenceshow Hello name!print("Hello " + str(name) + "!")
Beginnersay "Hello"print("Hello")
Beginnersay total + 1print(total + 1)
Advancedprint("Hello")unchanged

Text or code. After an action word, a valid Python expression whose names the program already knows is treated as code; anything else is text. say and 말해 are the exception: they try the expression first. A name introduced earlier is substituted into text (show Hello name! → "Hello " + str(name) + "!").

⚠ All it takes is a word that matches a name. Make a name called morale and the meal raised morale a lot becomes "the meal raised " + str(morale) + " a lot". The same holds in a condition: where wardRune is a true/false name, if choice equals wardRune compares against that value rather than against the text "wardRune".

Quotes say the thing is text. What is inside them stays text even where a name of the same spelling exists.

say "the meal raised morale a lot"      → printed as it stands
if choice equals "wardRune"             → compared against the text

The easier habit is to name things in a shape prose does not use — fightingSpirit rather than morale, hasWardRune rather than wardRune. Short common words are the dangerous ones.

2. Input

LevelNMEPython produced
Sentenceask name What is your name?name = input("What is your name?" + " ")
Sentenceask number age How old are you?age = int(input("How old are you?" + " "))
SentenceWhat is your name?name = input("What is your name?" + " ")
SentenceHow old are you?age = int(input("How old are you?" + " "))
Sentencename askname = input()
Beginnerask name, "Name? "name = input("Name? ")
Advancedname = input()unchanged

ask number / 숫자로 produces int(input(...)). A question about an age or a count (How old are you?, 몇 살이에요?) is read as a number without it. A prompt that does not end in a space gets one.

3. Save a value

LevelNMEPython produced
Sentenceset greeting to Hellogreeting = "Hello"
Sentenceset answer to 7answer = 7
Sentencegreeting save Hellogreeting = "Hello"
Sentenceremember score to 0score = 0
Sentenceset score to 0.score = 0
Beginnersave total to 1 + 2total = 1 + 2
Advancedgreeting = 'Hello'unchanged

Korean marks the target with the particle 은/는 and needs no action word. English has no such particle, so it uses set … to ….

4. Change a value

LevelNMEPython produced
Sentencescore add 1score = score + 1
Sentenceadd 1 to scorescore = score + 1
Sentencescore increase by 1score = score + 1
Sentenceto score add 1score = score + 1
Sentencesubtract 1 from scorescore = score - 1
Sentencemultiply score by 2score = score * 2
Sentencedivide score by 2score = score / 2
Sentencesubtract 1 + 2 from scorescore = score - (1 + 2)
Advancedscore += 1unchanged

⚠ A multi-word amount is parenthesised: subtract 1 + 2 from score is score - (1 + 2), not score - 1 + 2.

5. Wait

LevelNMEPython produced
Sentencewait 3 seconds__import__("time").sleep(3)
Sentencepause 3__import__("time").sleep(3)
Sentencewait 1 second__import__("time").sleep(1)
Sentencewait two seconds__import__("time").sleep(2)
Sentencewait for 5 seconds__import__("time").sleep(5)
Sentencesleep pause_length__import__("time").sleep(pause_length)
Advancedimport time; time.sleep(3)unchanged

The unit word (seconds, 초) is optional. A line with no number in it (잠깐 기다려) stays ordinary output.

6. Repeat a number of times

LevelNMEPython produced
Sentencerepeat 3 times and show Againfor _ in range(3): print("Again")
Sentence3 times Welcomefor _ in range(3): print("Welcome")
Sentencerepeat three times and show Againfor _ in range(3): print("Again")
Sentencerepeat 3 rounds and show Againfor _ in range(3): print("Again")
Sentencerepeat 3 times … endfor _ in range(3):
Sentencerepeat foreverwhile True:
Sentencerepeat forever and show Againwhile True: print("Again")
Beginner3 times: say "Hi"for _ in range(3): print("Hi")
Sentencecount n from 1 to 10for n in range(1, 11):
Sentencerepeat with n from 10 to 1for n in range(10, 0, -1):
Sentencecount n from 1 to peoplefor n in (range(1, people + 1) if 1 <= people else range(1, people - 1, -1)):
Sentencecount n from 1 to 3 and show nfor n in range(1, 4): print(n)
Beginnercount n from 1 to 10:for n in range(1, 11):
Advancedfor i in range(3):unchanged

A block closes three ways: by indentation, by one statement after :, or by a line containing only end / 끝.

A counting loop counts both ends. With two written numbers it counts up or down by which is bigger; with a name at either end it decides when the loop starts.

7. Repeat over a list

LevelNMEPython produced
Sentencefor each friend in friendsfor friend in friends:
Sentencefor each friend in friends and show friendfor friend in friends: print(friend)
Sentencerepeat for each name in namesfor name in names:
Sentenceforeach friend in friendsfor friend in friends:
Sentencefor every friend in friendsfor friend in friends:
Sentencefor each friend in friends with placefor place, friend in enumerate(friends, 1):
Beginnerfor each friend in friends:for friend in friends:
Beginnerfor each friend in friends with place:for place, friend in enumerate(friends, 1):
Advancedfor friend in friends:unchanged

The name before in / 마다 holds each item in turn, and the block body can use it immediately.

8. Repeat while a condition holds

LevelNMEPython produced
Sentencewhile score is less than 3while (score < 3):
Sentencewhile ready and waitingwhile (ready and waiting):
Sentencewhile score is greater than 0while (score > 0):
Sentencewhile ready then show workingwhile (ready): print("working")
Beginnerwhile score < 3while (score < 3):
Advancedwhile score < 3:unchanged

9. Conditions

LevelNMEPython produced
Sentenceif score is greater than 10 then show You wonif (score > 10): print("You won")
Sentenceif name existsif (name):
Sentenceif darkif (dark):
Sentenceif the length of name is greater than how many friendsif (len(name) > len(friends)):
Sentenceif score > 10 then show You wonif (score > 10): print("You won")
Sentenceif score is above 10 then show You wonif (score > 10): print("You won")
Sentencescore is greater than 5 then show highif (score > 5): print("high")
Sentenceelse if score equals 0elif (score == 0):
Sentenceelseelse:
Beginnerwhen score == 1: say "one"if (score == 1): print("one")
Advancedif score == 1:unchanged

The right of a comparison takes every reading the left takes — a length, a count, a remainder, a quotient, arithmetic — and only from a name the program already made; anything else is text as before. In Korean a one-syllable name with the ending glued on — 만약에 밤이면, 만약에 비면, 만약에 비라면 — tests that name alone, like if dark, when the program made it.

10. Comparison vocabulary

NMEPythonMeaning
if name existsname참인 값 / truthy
if name missingnot (name)거짓인 값 / falsey
if score equals 10score == 10==
if score is not equal to 10score != 10!=
if score is greater than 10score > 10>
if score is less than 10score < 10<
if score is greater than or equal to 10score >= 10>=
if score is less than or equal to 10score <= 10<=
if ready and score > 2ready and score > 2and / 그리고
if ready or waitingready or waitingor / 또는

English accepts synonyms for the comparison words: greater, above, great, larger, bigger, higher all mean >; less, below, small, smaller, lower all mean <; equals, equal, same mean ==.

11. Loop control

LevelNMEPython produced
Sentencebreakbreak
Sentencebreak herebreak
Sentencestopbreak
Sentenceexit loopbreak
Sentencequitbreak
Sentenceskipcontinue
Sentencekeep goingcontinue
Sentenceend(closes the block)
Sentencefinish(closes the block)

break and skip (멈춰, 건너뛰어) are valid Python names on their own, so they are read as NME only inside a loop block. Outside one they stay Python.

12. Lists

LevelNMEPython produced
Sentenceset friends to list of Mina, Adafriends = ["Mina", "Ada"]
Sentenceset friends to list of Mina and Adafriends = ["Mina", "Ada"]
Sentenceset scores to list of 1, 2, 3scores = [1, 2, 3]
Sentenceset friends to list offriends = []
Sentenceappend Mina to friendsfriends.append("Mina")
Sentencepush Mina to friendsfriends.append("Mina")
Sentenceadd Mina to friendsfriends.append("Mina")
Sentenceto friends append Minafriends.append("Mina")
Sentenceset friends to an empty listfriends = []
Sentenceremove Mina from friendsfriends.remove("Mina")
Sentenceshow how many friendsprint(len(friends))
Sentenceset total to how many friendstotal = len(friends)
Sentenceshow You have how many friends leftprint("You have " + str(len(friends)) + " left")
Sentencesort friendsfriends.sort()
Sentencereverse friendsfriends.reverse()
Sentenceshuffle friends__import__("random").shuffle(friends)
Sentenceshow the first of friendsprint(friends[0])
Sentenceshow the last of friendsprint(friends[-1])
Sentenceshow item 2 of friendsprint(friends[1])
Sentenceset item 1 of friends to Adafriends[0] = "Ada"
Sentencechange the last of scores to 9scores[-1] = 9
Sentenceset the first of scores to 9scores[0] = 9
Sentenceset item score of scores to 0scores[score - 1] = 0
Sentenceshow a random one of friendsprint(__import__("random").choice(friends))
Sentenceset chosen to a random item from friendschosen = __import__("random").choice(friends)
Sentenceshow a random element in friendsprint(__import__("random").choice(friends))
Sentenceshow the total of scoresprint(sum(scores))
Sentenceshow the biggest of scoresprint(max(scores))
Sentenceshow the smallest of scoresprint(min(scores))
Sentenceshow friends joined by commaprint(", ".join(map(str, friends)))
Sentenceshow friends joined by spaceprint(" ".join(map(str, friends)))
Sentenceshow friends joined togetherprint("".join(map(str, friends)))
Sentenceshow friends joined by nothingprint("".join(map(str, friends)))
Sentenceif friends contains Minaif ("Mina" in friends):
Sentenceif friends does not contain Adaif ("Ada" not in friends):
Sentenceif friends is emptyif (not (friends)):
Beginnersay len(friends)print(len(friends))
Advancedfriends = ["Mina"]unchanged

Without the list of / 목록 marker a comma-separated line is ordinary text. append Mina to friends (a list) and add 1 to score (a number) are different commands and keep their own meanings.

Items are counted from one. the first of friends is item 1 of friends and becomes friends[0]. There is no item 0; writing one is E0229. Changing an item counts the same way. A record has no numbered items, so changing one of a record is E0234.

The statements that read or rearrange a list (how many, sort, shuffle, the first of, the total of, remove, …) only work on a name the program already made a list. That is what keeps sort out your things and the first of many ordinary sentences. Using one on a name that is not a list is E0231.

comma joins with a comma and a space (", "), space with one space, and newline with a line break. Items go through map(str, …), so a list of numbers joins as readily as a list of words.

13. Records

LevelNMEPython produced
Sentenceset ages to an empty recordages = {}
Sentenceset ages to recordages = {}
Sentenceset ages to an empty tableages = {}
Sentenceput Mina at 90 in agesages["Mina"] = 90
Sentenceput Mina as 90 in agesages["Mina"] = 90
Sentenceset Mina to 90 in agesages["Mina"] = 90
Sentenceshow Mina in agesprint(ages["Mina"])
Sentenceset best to Mina in agesbest = ages["Mina"]
Sentenceshow how many agesprint(len(ages))
Sentenceif ages contains Minaif ("Mina" in ages):
Sentencefor each name in agesfor name in ages:
Sentenceremove Mina from agesdel ages["Mina"]
Beginnersave rates to {}rates = {}
Beginnersay ages["Mina"]print(ages["Mina"])
Advancedages["Mina"] = 90unchanged

A record holds many named values at once. Python calls it a dictionary; a beginner calls it a list of names and what goes with each.

an empty record / 빈 표 is only a record where a value is being saved. An ordinary sentence holding the same word — I keep a record of everything I read — stays a sentence.

The spellings a record shares with a list — how many, remove, contains, for each, 개수, 빼, 넣어 — are the same words, and what they do depends on which kind the name holds. That is deliberate: a reader should not have to remember which is which. Using a record line on a list is E0234.

A record has no order, so the total of, the biggest of, the first of and sort are not written for one. for each name in ages hands back the names, so the value is read back with name in ages.

set Mina to 90 in ages and set best to Mina in ages are the same six words in the same order, and they mean opposite things. What follows to decides: a number or a quoted string is a value being written, and a word is a name being read. A record kept under numbers is still readable — put the number in a name first (set key to 90, then set who to key in ages).

A name Python wrote as ages = {} is a record too.

14. Working with text

LevelNMEPython produced
Sentenceshow the length of nameprint(len(name))
Sentenceshow name in capitalsprint(str(name).upper())
Sentenceshow name in small lettersprint(str(name).lower())
Sentenceset names to memo split by linenames = str(memo).splitlines()
Sentenceset fields to memo split by commafields = str(memo).split(",")
Sentenceset line to friends joined by commaline = ", ".join(map(str, friends))
Sentenceset level to levelText as a numberlevel = int(levelText)
Sentenceset words to memo split by spacewords = str(memo).split(" ")
Sentenceset bar to name repeated 5 timesbar = str(name) * 5
Sentenceshow name repeated 3 timesprint(str(name) * 3)
Beginnersay len(name)print(len(name))
Advancedname.upper()unchanged

the length of gives how many characters a piece of text has, and in capitals / in small letters give the same text with its letters changed. All three are values, so they work in output, in a saved name, and in a condition. They only read a name the program already made, which is what keeps an ordinary sentence containing one of those words a sentence.

15. Arithmetic and remainders

LevelNMEPython produced
Sentenceset left to total minus scoreleft = total - score
Sentenceshow score plus peopleprint(score + people)
Sentenceset double to score times 2double = score * 2
Sentenceset double to score multiplied by 2double = score * 2
Sentenceset each to total divided by peopleeach = total / people
Sentenceset big to score plus people times 2big = score + people * 2
Sentenceif total minus score is greater than 3if (total - score > 3):
Sentenceshow the remainder of score divided by 4print(score % 4)
Sentenceset left to the remainder of score divided by 4left = score % 4
Sentenceif the remainder of score divided by 4 equals 0if (score % 4 == 0):
Sentenceshow the whole number of score divided by 4print(score // 4)
Sentenceset rows to the whole number of score divided by peoplerows = score // people
Sentenceset rows to the quotient of score divided by 4rows = score // 4
Beginnersay score % 4print(score % 4)
Beginnersay score // 4print(score // 4)
Beginnersave left to total - scoreleft = total - score
Advancedleft = score % 4unchanged
Advancedrows = score // 4unchanged
Advancedleft = total - scoreunchanged

plus, minus, times, multiplied by and divided by — 더하기, 빼기, 곱하기, 나누기 in Korean — are Python's + - * /. They are arithmetic only when every side is a written number or a name the program already made; if any side is anything else, the words are text as before, so 설탕 빼기 and one plus one equals two still print themselves. A chain follows the order a maths book uses, multiplying and dividing first. The value can be saved, can be the whole of what is shown, and can stand on either side of a comparison.

the remainder of is what is left over after a division, and the whole number of is how many whole times one goes into the other. Both are values, so they work in output, in a saved name, and in a condition; the number being divided by must be a number or a name the program already made.

divided by and divide are Python's /, so the answer is a fraction. A fraction cannot be a position in a list, a number of repeats, or a saved score, and the program stops where one is used as any of those. Ask for the whole number instead.

16. Values and literals

EnglishKoreanPython
True · true참True
False · false거짓False
None · none · null없음None

17. Randomness

LevelNMEPython produced
Sentenceset die to random number from 1 to 6die = __import__("random").randint(1, 6)
Sentenceset color to pick from red or greencolor = __import__("random").choice(("red", "green",))
Sentenceset color to choose from red or greencolor = __import__("random").choice(("red", "green",))
Beginneruse random(binds the random helpers)
Beginnersay random_number(1, 6)print(random_number(1, 6))

A choice written as a number stays a number (pick from 1 or 2 → choice((1, 2,))).

18. Chance

LevelNMEPython produced
Sentence30% chance show You winif __import__("random").randrange(1000) < 300: print("You win")
Sentence30.5% chance show You winif __import__("random").randrange(1000) < 305: print("You win")
Sentencewith a 30% chance show You winif __import__("random").randrange(1000) < 300: print("You win")
Sentence30 percent chance show You winif __import__("random").randrange(1000) < 300: print("You win")
Sentence30% of the time show You winif __import__("random").randrange(1000) < 300: print("You win")
Sentence30% chanceif __import__("random").randrange(1000) < 300:
Sentenceluck is a 30% chanceluck = __import__("random").randrange(1000) < 300

30% means 300 times in a thousand. One decimal place is the finest you may write (30.5%); anything finer is reported as E0227 rather than rounded, because a program must never quietly mean something you did not write. The range is 0% to 100%, and outside it you get E0228. 100% always happens and 0% never does. The comparison is between whole thousandths, so no floating-point rounding can creep in.

A chance saved in a name is an ordinary true/false value, so the usual condition words can ask about it: if luck then show You win.

19. Files

LevelNMEPython produced
Sentenceread "notes.txt" into memomemo = __import__("pathlib").Path("notes.txt").read_text()
Sentencewrite "hello" to "out.txt"__import__("pathlib").Path("out.txt").write_text("hello")
Beginneruse file(binds the file helpers)
Beginnersay file_read("notes.txt")print(file_read("notes.txt"))

A file path is always quoted. This is the one place the sentence level asks for a quote character.

20. Modules

LevelNMEPython produced
Beginneruse random(binds random, random_number, random_pick, shuffle and their Korean twins)
Beginneruse file(binds file_read, file_write, json_load, json_save and their Korean twins)
Beginneruse zero_knowledge(binds zk_secret, zk_public, zk_nizk_prove, … and their Korean twins)
Beginneruse list(binds count, sort, reverse, remove, first, last, sum, largest, smallest and their Korean twins)
Beginneruse text(binds upper, lower, trim, split, join, replace, starts_with, length and their Korean twins)
Beginneruse math(binds math, root, round_to, pi, power, absolute, floor, ceil and their Korean twins)
Beginneruse date(binds today, now, year, month, day_of_month, weekday, days_after and their Korean twins)
Beginneruse random latest(the newest bundled adapter)
Beginneruse random version "0.0.1"(that exact adapter)
Sentenceuse greet from "helper.nme"(from helper import greet — needs helper.nme next to the program)
Beginnerfrom "helper.nme" import greet(from helper import greet — needs helper.nme next to the program)
Advancedfrom "helper.nme" import greet(from helper import greet — needs helper.nme next to the program)

After use random, use file and use zero_knowledge, the four most asked for are use list, use text, use math and use date. One line makes every name below ready in both languages, and everything inside them is plain Python builtins, so they run in the browser as they stand. list, text, math and date are ordinary words, so they name a module only when they stand beside use/사용 and nothing else is left over on the line; get the list of names and What is the date today? are sentences and print.

yesterday, tomorrow, 3 days ago and 3 days from now — Korean 어제, 내일, 3일 전, 3일 뒤 — are the sentence way to step off today. They mean a date only after the toolbox is open, so 3 days ago I saw her and 약속은 3일 전이었습니다 are sentences and print.

Six of the date names answer with nothing written after them, so they may be written without brackets and a whole date program stays sentences: show today, show weekday, show year, 오늘 말해줘, 요일 말해줘, 올해 말해줘 — and now/지금, month/이번달, day_of_month/오늘일자 the same way. days_after(n) is not one of them: it needs the number written after it, and what is missing there is the writer's, not the compiler's.

On a Wednesday, weekday() answers Wednesday and its Korean name 요일() answers 수요일. This is the one place in any bundled module where the two names hold different values: a weekday name is a word rather than a number, so it has to be in some language, and the name you write chooses which. The clock a browser hands Python is UTC, so in the browser today() is today in UTC.

use list (목록 사용):

EnglishKoreanPython
count(values)개수(값들)len(values)
sort(values)정렬(값들)sorted(values) — a new list; the original is left alone
reverse(values)뒤집기(값들)list(reversed(values))
remove(values, x)빼기(값들, x)every item that is not x, as a new list
first(values)첫번째(값들)values[0]
last(values)마지막(값들)values[-1]
sum(values)합계(값들)sum(values)
largest(values)최대(값들)max(values)
smallest(values)최소(값들)min(values)
list_version목록버전"0.0.1"

use text (글자 사용):

EnglishKoreanPython
upper(text)대문자(글)str(text).upper()
lower(text)소문자(글)str(text).lower()
trim(text)공백없애기(글)str(text).strip()
split(text, sep)나누기(글, 구분자)str(text).split(sep)
join(sep, values)합치기(구분자, 값들)str(sep).join(map(str, values))
replace(text, a, b)바꾸기(글, a, b)str(text).replace(a, b)
starts_with(text, a)로시작(글, a)str(text).startswith(a)
length(text)길이(글)len(text)
text_version글자버전"0.0.1"

use math (수학 사용):

EnglishKoreanPython
root(x)제곱근(x)math.sqrt(x)
round_to(x, places)반올림(x, 자리)round(x, places) — places may be left out
pi원주율math.pi
power(x, y)거듭제곱(x, y)pow(x, y) — whole numbers stay whole
absolute(x)절댓값(x)abs(x)
floor(x)내림(x)math.floor(x)
ceil(x)올림(x)math.ceil(x)
math_version수학버전"0.0.1"

use date (날짜 사용):

EnglishKoreanPython
today()오늘()date.today().isoformat() — text such as "2026-08-19"
now()지금()datetime.now().strftime("%H:%M") — the clock a browser gives is UTC
year()올해()date.today().year
month()이번달()date.today().month
day_of_month()오늘일자()date.today().day
weekday()요일()strftime("%A"), an English name such as Wednesday; the Korean name answers 수요일
days_after(n)며칠뒤(n)(date.today() + timedelta(days=n)).isoformat(); a negative n reads as days before
date_version날짜버전"0.0.1"

sort, reverse and remove hand back a new list and leave the original alone. To change the list itself, use the sentence statements sort friends, reverse friends and remove Mina from friends.

21. Slow text

LevelNMEPython produced
Sentencesay slowly Hello[print(_ch, end="", flush=True) or __import__("time").sleep(0.04) for _ch in "Hello"]; print()
Sentenceshow slowly Hello[print(_ch, end="", flush=True) or __import__("time").sleep(0.04) for _ch in "Hello"]; print()
Sentencesay very slowly Hello[print(_ch, end="", flush=True) or __import__("time").sleep(0.12) for _ch in "Hello"]; print()
Sentencesay slowly every 3 seconds Hello[print(_ch, end="", flush=True) or __import__("time").sleep(3) for _ch in "Hello"]; print()

Each character is printed on its own with a short pause after it. The pause is 0.04 seconds by default, 0.12 with very, and whatever you name with every 3 seconds / 3초씩.

22. Stories

LevelNMEPython produced
Sentencestory:if True:
Sentenceslow story:if True:
Sentencevery slow story:if True:
Sentenceslow story every 3 seconds:if True:
SentenceThe door opened.print("The door opened.")
Sentencewait 3 seconds(inside a story: print("wait 3 seconds"))

Inside story: every line is text. wait 3 seconds and if ready are not commands there; they print, exactly as written. Writing something novel-like is the whole point of the form, so a line of prose can never quietly turn into a statement. Close the block with end / 끝, or, if you opened it by indenting, by ending the indentation. A blank line prints an empty line, names you made earlier are still substituted into the text, and the colon may be the plain : or the full-width : a Korean keyboard writes.

23. Named jobs

LevelNMEPython produced
Sentenceto greet:def greet():
Sentenceto greet:def greet():
Sentencedo greetgreet()
Sentencerun greetgreet()
Sentencedo greetgreet()
Sentenceto hail someone:def hail(someone):
Sentencedo hail with Minahail("Mina")
Sentencerun hail with Minahail("Mina")
Sentencegive back scorereturn score
Sentenceanswer with scorereturn score
Sentenceshow the result of greetprint(greet())
Sentenceset said to the result of hail with Minasaid = hail("Mina")
Advanceddef greet():unchanged
Advancedreturn scoreunchanged

A named job gives a piece of program a name, so it can be run later by that name. Python calls it a function (def).

to, do, 일 and 하기 are ordinary words, so a named job is recognized by structure and never by a word: the opening to (or, in Korean, the 라는 on the name and the 일 after it), the closing :, and a block underneath. to be honest and 할 일이 많습니다 have none of that.

Without a block it is not a job. A heading such as To do: on its own is printed as the line it is, and there is no one-line form.

The line that runs a job only runs one when the name is a job this program already made. do and run decide nothing on their own. A Python def that takes no arguments can be run the same way.

A name saved inside a job stays inside it, exactly as in a Python function.

⚠ A name a job reads has to exist above the job. A word that is only given a value further down the file is read as text rather than as a name. It compiles, and it stops the program at run time instead.

to draw bar amount:
    set left to barMax        ← becomes barMax = "barMax"
end
set barMax to 20              ← has to be above the job, not here

Gather the values a job reads before you write the job. A block of settings at the top of the program is the safest place for them.

A job may be given one thing. The header names it in front of the job name (to greet someone:, 이름에게 인사하기라는 일:), and the line that runs the job hands it over the same way (do greet with Mina, 민수에게 인사하기 해줘). Giving a job the wrong number of things is refused with E0235, because the Python TypeError it would otherwise cause happens at run time on a line that looks right.

A job can hand an answer back. Write give back <value> inside it, and the place that ran the job becomes that value. answer with <value> is the same thing. To take the answer, write set <name> to the result of <job> with <thing>, or the result of <job> where the job is given nothing. It is a value, so it works in output, in a saved name, and in a condition.

to twice amount:
    give back amount + amount
end
set answer to the result of twice with 5
show answer

give back only means that inside a job. give back the book outside one is the sentence it looks like and prints. The job name carries the same kind of gate: the result of only asks for an answer where the name is one this program has already made a job.

Sentence grammar has no job that takes two things yet. Write a Python def when you need one.

24. Screen

LevelNMEPython produced
Sentenceclear the screenprint("\033[2J\033[3J\033[H", end="")
Sentenceclear screenprint("\033[2J\033[3J\033[H", end="")
Sentencedraw a lineprint("─" * 40)
Sentencedraw lineprint("─" * 40)
Sentencesay in a box Helloprint((lambda _t: (lambda _w: "┌" + "─" * (_w + 2) + "┐\n│ " + _t + " │\n└" + "─" * (_w + 2) + "┘")(sum(2 if __import__("unicodedata").east_asian_width(_c) in "WF" else 1 for _c in _t)))("Hello"))
Sentencesay in the middle Helloprint((lambda _t: " " * max(0, (40 - sum(2 if __import__("unicodedata").east_asian_width(_c) in "WF" else 1 for _c in _t)) // 2) + _t)("Hello"))

Clearing the screen sends a terminal control sequence, so somewhere that is not a terminal it may show up as text. The box and the centred line count a Korean character as two columns, so a Korean sentence comes out straight; the width is 40 columns.

25. The stopwatch

LevelNMEPython produced
Sentencestart the timer_nme_clock = __import__("time").time()
Sentencestart timer_nme_clock = __import__("time").time()
Sentenceshow elapsedprint(round(__import__("time").time() - _nme_clock, 2))
Sentenceset spent to elapsedspent = round(__import__("time").time() - _nme_clock, 2)

start the timer starts the clock and elapsed / 잰시간 / 걸린시간 reads how many seconds have passed, to two decimal places. It is a value, so it works in output, in a saved name, and in a condition (if elapsed is greater than 3). Reading it without starting the clock is reported at compile time as E0226. A name the program made itself always wins over the word.

26. Cooldowns

LevelNMEPython produced
Sentenceput door on cooldown for 3 seconds_nme_cool_door = __import__("time").time() + 3
Sentencewhen door is readyif (__import__("time").time() >= _nme_cool_door):
Sentenceif door is readyif (__import__("time").time() >= _nme_cool_door):
Sentencewhen door is on cooldownif (__import__("time").time() < _nme_cool_door):
Sentencewait for door__import__("time").sleep(max(0, _nme_cool_door - __import__("time").time()))
Sentencepause for door__import__("time").sleep(max(0, _nme_cool_door - __import__("time").time()))

One cooldown belongs to one name. put door on cooldown for 3 seconds remembers the moment three seconds from now, and is ready / 쿨타임이 끝났으면 asks whether that moment has passed. They are conditions, so they work with when, while, else if, and the one-line form of all three. wait for door also reads as an ordinary English sentence, so a name the program already saved as something else is not read as a cooldown.

27. Every action word

Every spelling accepted for each action, with nothing left out.

ActionEnglish spellingsKorean spellings
출력 / Outputsay · show · display · tell · print말해 · 말해줘 · 말해주세요 · 보여줘 · 보여주세요 · 출력해 · 출력해줘 · 출력해주세요 · 해줘 · 해주세요 · 읽어줘
입력 / Inputask · prompt · question물어봐 · 물어봐줘 · 물어보세요 · 질문해 · 질문해줘 · 입력받아 · 입력받아줘 · 입력받아주세요 · 물어봐요 · 물어봐주세요 · 질문해주세요
저장 / Saveset · save · remember · store · let · make저장 · 저장해 · 저장해줘 · 기억해 · 기억해줘 · 설정 · 설정해 · 설정해줘 · 지정 · 지정해 · 정해 · 만들어
더하기 / Addadd · increase · increment · plus · up · goesup · grow · bump · boost더해 · 더해줘 · 올려 · 올려줘 · 늘려 · 늘려줘 · 더하기 · 증가 · 증가해 · 증가시켜
빼기 / Subtractsubtract · decrease · decrement · minus · remove · down · goesdown빼 · 빼줘 · 내려 · 내려줘 · 줄여 · 줄여줘 · 빼기 · 감소 · 감소해 · 감소시켜
곱하기 / Multiplymultiply · multiplied곱해 · 곱해줘 · 곱하기해
나누기 / Dividedivide · divided나눠 · 나눠줘 · 나누어줘
기다리기 / Waitwait · pause · sleep · hold · delay · rest기다려 · 기다려줘 · 기다리세요 · 기다려주세요 · 쉬어 · 쉬어줘 · 쉬세요 · 대기해 · 대기해줘 · 대기
반복 / Repeatrepeat · again · do반복 · 반복해 · 반복해줘 · 반복해주세요 · 반복하세요 · 반복해서 · 반복하고 · 반복한다음 · 다시해 · 다시해주세요
조건 / Ifwhen · if · should · incase · whenever만약 · 만약에 · 만일 · 혹시
조건 반복 / Whilewhile · aslongas · repeatwhile · keepgoingwhile동안 · 하는동안 · 할동안
다른 갈래 / Elseelse · otherwise · orelse · elseinstead아니면 · 아니면은 · 아니라면 · 그렇지않으면 · 그렇지않다면 · 안그러면 · 안그렇다면 · 그외에는 · 그외에 · 아니면만약 · 아니면만약에 · 그렇지않으면만약 · 그렇지않으면만약에
반복 중단 / Breakbreak · breakhere멈춰 · 멈춰줘 · 멈춰라 · 멈추기 · 그만해 · 정지해 · 종료해 · 중단 · 반복멈춰 · 여기서멈춰
말끝 출력 / Output written last—말하기 · 말해라 · 알려줘 · 알려주세요 · 알려줘요 · 얘기해 · 얘기해줘 · 얘기해주세요 · 표시해 · 표시해줘 · 출력하기 · 보여주기 · 프린트해 · 프린트 · 프린트해줘 · 프린트해주세요 · 표시하기
목적어가 없을 때만 말끝 출력 / Output written last, with no object—띄워 · 띄워줘 · 띄워주세요 · 나타내 · 나타내줘 · 나타내주세요 · 써줘 · 써주세요 · 적어줘 · 적어주세요
한 낱말만 보여 주기 / Show the one word after itoutput · write · echo · reveal · report · give · list · present · announce · speak · puts—
한 글자 출력 / Short output word—말
화면에 / On the screenscreen화면에 · 화면에다 · 화면에다가 · 스크린에
화면 동사 / Screen verbput · write · print · show · display · say · tell · output · draw띄워 · 띄워줘 · 보여줘 · 출력해 · 말해 · 말해줘 · 표시해
물음표가 있을 때만 묻기 / Ask, only with a question markread · get · request · enter · input받아 · 받아줘 · 여쭤봐 · 여쭤봐줘 · 여쭈어봐 · 요청해 · 요청해줘 · 요청해주세요 · 달라고해 · 달라고해줘
짧은 물어보기 / Short asking word—물어
~로 해 / Save with the everyday verbbecomes · become · call해 · 하자 · 합시다 · 하죠 · 부르자 · 두어 · 둬 · 두자
~로 / ~라고 표시 / What the name becomes—으로 · 로 · 이라고 · 라고
횟수가 있을 때만 반복 / Repeat, only with a countloop · iterate · cycle · rep · goround · runthrough돌려 · 돌려줘 · 돌려주세요 · 되풀이 · 되풀이해 · 되풀이해줘 · 되풀이해서 · 되풀이하기
반복할 것을 가리키는 말 / What is being repeatedit · this · that그거 · 그걸 · 그것 · 그것을 · 이거 · 이걸 · 이것 · 이것을
조건을 닫는 말 / Word that closes a condition—때 · 때에 · 때는 · 경우 · 경우에 · 경우에는
건너뛰기 / Skipskip · skipthis · skipit · nextone건너뛰어 · 건너뛰어줘 · 건너뛰기 · 건너뛰자 · 넘어가 · 넘어가줘 · 계속해 · 넘겨 · 다음
블록 닫기 / Endend · finish · done끝 · 종료 · 마침
모듈 쓰기 / Useuse · load · get · import사용 · 사용해 · 사용해줘 · 사용해주세요 · 불러와 · 불러와줘 · 가져와 · 가져와줘 · 받아 · 받아줘
다른 파일에서 / Import from a fileuse · take · borrow가져와 · 가져와줘 · 가져오기 · 불러와 · 불러오기
목록에 넣기 / Appendappend · push · insert · put · place넣어 · 넣어줘 · 넣기 · 추가해 · 추가해줘 · 추가하기 · 붙여 · 붙여줘
목록 표시 / Listlist목록 · 리스트
빈 목록 / Empty listempty · blank빈 · 비어있는 · 새
개수 / How manycount · number · many개수 · 갯수
개수 앞말 / Reading leadhow—
길이 / Lengthlength · size길이 · 글자수
합 / Totaltotal · sum합 · 합계 · 총합
최댓값 / Biggestbiggest · largest · highest · maximum최댓값 · 최대값 · 큰
최솟값 / Smallestsmallest · lowest · minimum최솟값 · 최소값 · 작은
최댓값 앞말 / Extreme scope—중 · 중에서 · 가운데
가장 / Most—가장 · 제일
것 / Thing—것 · 값
첫 번째 / Firstfirst첫번째 · 첫째 · 처음 · 첫
마지막 / Lastlast마지막 · 맨뒤
몇 번째 / Itemitem · element번째 · 째
항목 바꾸기 / Change an itemset · change바꿔 · 바꿔줘 · 바꿔주세요
아무거나 / A random itemrandom아무거나 · 아무것이나
아무거나 뒷말 / A random oneone · item · element—
세면서 / Countingcount세면서 · 세며
대문자 / Capitalscapitals · capital · uppercase대문자로 · 대문자
소문자 / Small letterslowercase · small소문자로 · 소문자
이어 붙이기 / Joinjoined · join이어 · 이어서 · 이어붙여
사이 없이 이어 붙이기 / Join togethertogether붙여 · 붙여서 · 붙여줘 · 이어붙여 · 이어붙여줘
빈 이음말 / Empty separatornothing그대로
나누기(글) / Splitsplit나눈 · 쪼갠 · 자른
줄마다 / By lineline · lines줄마다 · 줄별로 · 한줄씩
나눈 것 / Split thing—것 · 거 · 것들
붙인 것 / Repeated textrepeated붙인 · 이어붙인
몇 개 / Copiestimes개 · 번
몇 번째와 함께 / With its positionwith함께 · 같이
나머지 / Remainderremainder · rest · leftover나머지
돌려주기 / Give backgive · hand · send돌려줘 · 돌려줘요 · 돌려주기 · 돌려줍니다 · 돌려주세요
돌려주기 뒷말 / Backback—
답으로 / Answer withanswer결과로 · 답으로 · 결과는 · 답은
한 결과 / The result ofresult · answer결과 · 답 · 결과값
한 / Having run—한 · 해서 · 실행한 · 시킨
몫 / Quotientquotient몫
더하기 / Plusplus더하기
빼기 / Minusminus빼기
곱하기 / Timestimes · multiplied곱하기
나누기 / Divided bydivided나누기
온전한 수 / Whole numberwhole—
이은 것 / Joined thing—이은 · 이어붙인 · 붙인
바꾼 것 / Changed into—바꾼 · 고친 · 읽은
나누기 말 / Divideddivided · shared · split나눈 · 나눈뒤 · 나누고
이음말 / Separatorcomma · space · newline쉼표 · 빈칸 · 공백 · 줄바꿈
정렬 / Sortsort · order · arrange · sortout정렬해 · 정렬해줘 · 정렬 · 정렬하기 · 순서대로 · 순서대로해 · 차례대로 · 차례대로해 · 오름차순 · 오름차순으로 · 오름차순으로해
거꾸로 / Reversereverse · flip · invert거꾸로 · 거꾸로해 · 거꾸로해줘 · 뒤집어 · 뒤집어줘 · 뒤집기 · 반대로 · 반대로해 · 역순으로 · 역순으로해
섞기 / Shuffleshuffle · mix · jumble · scramble · randomise · randomize섞어 · 섞어줘 · 섞어주세요 · 섞기 · 랜덤하게 · 랜덤하게해 · 무작위로해
들어있는지 / Containscontains · contain · includes · include · holds안에는 · 속에는 · 안에 · 속에 · 에는 · 에
표 표시 / Recordrecord · table표
표에 넣기 / Put in a recordput · set · store · save · record · add넣어 · 넣어줘 · 넣어주세요 · 넣기 · 두어 · 두어줘 · 저장해 · 저장해줘 · 기억해 · 기억해줘 · 적어 · 적어줘
표 값 앞말 / Record value connectorat · as으로 · 로
표 이름 앞말 / Record container connectorin · into · to을 · 를
표에서 읽기 조사 / Record reading particle—에서 · 의
일 표시 / Jobto일 · 작업
일 이름 어미 / Job name ending—이라는 · 라는
일 실행 / Run a jobdo · run해 · 해줘 · 해주세요 · 실행해 · 실행해줘
일이 받는 것 / What a job is givenwith에게 · 한테 · 을 · 를
무한 반복 / Foreverforever · always계속 · 무한 · 끝없이
읽기 조사 / Reading particle—이 · 가 · 은 · 는 · 을 · 를
숫자로 / As a numbernumber · numeric숫자 · 숫자로 · 수로
숫자 낱말 / Number wordszero · one · two · three · four · five · six · seven · eight · nine · ten · once · twice하나 · 한 · 둘 · 두 · 셋 · 세 · 넷 · 네 · 다섯 · 여섯 · 일곱 · 여덟 · 아홉 · 열 · 일 · 이 · 삼 · 사 · 오 · 육 · 칠 · 팔 · 구 · 십
횟수 단위 / Count unittimes · time · loops · loop · rounds · round번 · 회 · 차례 · 판
반복 중단(블록 안) / Break inside a blockstop · stophere · exitloop · quit—
건너뛰기(블록 안) / Skip inside a blockkeepgoing · carryon—
무작위 고르기 / Random pickrandomchoice · pick · choose랜덤선택 · 하나골라 · 골라 · 하나뽑아 · 뽑아
값 바꾸기 연결어 / Value-change connectorto · by · from · of · into · onto—
목록 연결어 / List connectorto · into · onto · in에다가 · 에다 · 에 · 한테 · 에게
저장 대상 조사 / Saved-name particle—을 · 를 · 이 · 가 · 에
문장 어미 / Sentence ending—입니다 · 이에요 · 예요 · 이다 · 으로 · 로 · 라고 · 이라고
최신판 / Latestlatest · newest최신 · 최신판 · 최신버전
파일 읽기 / File readread읽어서 · 읽고 · 읽어
파일 쓰기 / File writewrite저장해 · 저장해줘 · 써줘 · 적어
천천히 / Slowlyslowly천천히
아주 / Veryvery아주
글자 간격 / Intervalevery초씩
화면 / Clear screenclear화면
화면 지우기 / Clear screen actionscreen지워 · 지워줘 · 비워 · 비워줘
줄 / Draw linedraw줄 · 가로줄
줄 긋기 / Draw line actionline그어 · 그어줘
상자 / Boxbox상자로
가운데 / Middlemiddle가운데
시간 재기 / Start timerstart시간재기시작해 · 시간재기시작
시계 / Timertimer—
잰 시간 / Elapsedelapsed잰시간 · 걸린시간
쿨타임 / Cooldowncooldown쿨타임 · 쿨타임을 · 쿨타임은 · 쿨타임이
쿨타임 걸기 / Put on cooldownput걸어 · 걸어줘
쿨타임 끝남 / Readyready끝났으면
쿨타임 남음 / On cooldown—남았으면
쿨타임 끝날 때까지 / Until ready—끝날때까지
이야기 / Storystory · tale이야기 · 얘기
이야기 천천히 / Story, slowlyslow · slowly천천히
확률 / Chancechance · chances · probability확률로 · 확률
퍼센트 / Percentpercent · percentage퍼센트 · 프로
확률 앞뒤 말 / Chance connectorwith의 · 로 · 으로
확률의 다른 말 / Chance, other wordingtime—
확률 저장 / Chance saved in a nameis · equals—
군말 / Fillerplease좀 · 혹시 · 제발

28. Korean particles

These endings are not treated as part of the name they follow.

에게서는 · 한테서는 · 에게서 · 한테서 · 으로는 · 로는 · 에게 · 한테 · 에서 · 으로 · 까지 · 부터 · 처럼 · 보다 · 이라도 · 라도 · 만큼 · 밖에 · 에는 · 에서 · 은 · 는 · 이 · 가 · 을 · 를 · 와 · 과 · 도 · 의 · 에 · 로 · 아 · 야 · 랑 · 이랑 · 예요 · 이에요 · 님 · 님께 · 님은 · 님이

29. Typo recovery

For action words and connectors only, and only after Python has rejected the line, NME retries once with a single edit repaired (one insertion, deletion, substitution, or adjacent swap). If more than one repair is possible it repairs nothing and points at the exact span instead. Strings and comments are never touched.

30. Error codes

CodeMeaning
E0001this line is not valid Python or NME
E0101an end with no open block
E0102break outside a loop
E0103an else or elif with no open condition
E0104two else branches in one condition
E0105a block without its closing end
E0106return outside a function
E0107continue outside a loop
E0108yield outside a function
E0109await outside an async function
E0110yield from inside an async function
E0111async for outside an async function
E0112async with outside an async function
E0113nonlocal with no enclosing function
E0114star import outside module scope
E0115control flow inside an except* block
E0116yield inside a comprehension
E0117async comprehension outside an async function
E0118return value inside an async generator
E0119conflicting global declaration
E0120conflicting nonlocal declaration
E0201a sum after say with a piece missing
E0202the value after say is not one Python can read
E0203the sentence to show is not valid
E0204say has nothing to show
E0211the question after the comma is missing
E0212NME could not read the question
E0213no name to hold the answer
E0221NME could not read the value change
E0222NME could not read the line that leaves the loop
E0223NME could not read the line that skips a round
E0224NME could not read how long to wait
E0225this list line could not be read
E0226the timer has not been started yet
E0227a chance can only go to one decimal place
E0228a chance must be between 0% and 100%
E0229items are counted from 1
E0230a name cannot have a space in it
E0231this name was never made into a list
E0232this story has nothing in it
E0233this join does not say what to put between the items
E0234a list line and a record line were mixed up
E0235this job is given a different number of things than it takes
E0236this job reads a name from outside and then changes it
E0237this name is one the language itself needs
E0238a file read with no name to read into
E0239a file name that is not in quotation marks
E0240putting something in requires a list
E0301the condition is missing
E0302NME could not read the condition
E0303NME could not read what to repeat
E0304NME could not read how many times to repeat
E0305the repeat count is missing
E0306NME could not read the line that goes through a list
E0307a counting loop needs a name to count with
E0401NME bundles seven modules, and this is not one of them
E0402latest and an exact version on one line
E0403the module version is missing
E0404this module version is not bundled
E0405the module would take over a name you made
E0406a module line NME could not read
E0407a module path this line cannot use
E0408a module import line NME could not read
E0409a module loaded twice
E0410a module tool with nothing to work on
E0411the value to save is missing
E0412NME could not read the value to save
E0413the name to save into is missing
E0414the name to save into is not a plain name
E0501the lines to repeat are not indented
E0502nothing to do when the condition is true
E0503a one-line block with nothing in it
E0504one thing to do per line
E0505the line inside this block is not one NME knows
E0506this line starts with a space
E0601the sentence could mean more than one action
E0602no NME action was found on this line
E0603NME does not know this word
E0604this line cannot do anything
E0605this line uses a curly quote
E0606a comparison that can never be true
E0701a sentence-style line across several physical lines
E0702the Python source is not valid
E9001unknown command
E9002modules takes no extra arguments
E9003an option is missing its value
E9004unknown option
E9005unexpected extra file
E9006convert needs a file
E9007a file could not be read
E9008a file could not be written
E9009refusing to overwrite the output
E9010the native compiler failed
E9011the native compiler could not be started
E9012CPython rejected the generated Python
E9013Python could not be started
E9014that is a folder, not a program
E9015the program file does not exist
E9016the current folder could not be read
E9017no .nme program in this folder
E9018the pick answer could not be read
E9019no pick answer given
E9020the pick answer is not a listed program
E9021the pick answer matches several programs
E9022several programs match this name
E9023the error lookup takes one code
E9024unknown error code
E9025pip could not install the package
E9026the native program could not be started
E9027a temporary working folder could not be created
E9028two imported modules have the same name
E9029module imports are not supported by nme compile
E9030the package name is missing
E9031-o is only available with nme native build
E9032more than one native action was given

Run nme en E0102 for the long explanation of a code (nme ko E0102 in Korean).

This page on GitHub