Night 16: Name tags
이미 Python 또는 의사 코드로 이날의 학습을 마쳤습니다. 두 언어 모두에서 완료한 것으로 인정됩니다. 원하면 다시 연습하세요.
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Tonight: name tags
- Your pet wants a name tag. Tonight you build text from pieces.
- You will learn one thing: joining text with
&.
Words for tonight
| Word | Meaning |
|---|---|
| join | put two pieces together into one |
| convert | change a value into another type |
| space | the empty character between words |
English
Join text with &
&puts two STRINGs together into one STRING.
DECLARE Name, Tag : STRING
Name ← "Kit"
Tag ← "Hello, " & Name & "!"
OUTPUT Tag
&adds no spaces. Write each space inside the quotes.

English
Numbers must become text first
&joins STRINGs only. Turn a number into a STRING withNUM_TO_STR.
DECLARE Age : INTEGER
Age ← 2
OUTPUT "Kit is " & NUM_TO_STR(Age) & " years old"
OUTPUT "Next year: " & NUM_TO_STR(Age + 1)
English
Commas or &?
| Code | What it does |
|---|---|
OUTPUT "Age: ", Age |
outputs the two values one after the other |
"Age: " & NUM_TO_STR(Age) |
makes one STRING you can store |
- Use commas to output quickly. Use
&when you need the text in a variable. - Now make some name tags!
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Read a name, then an age. Join the text with & to output Kit is 2 years old. Use NUM_TO_STR for the age.
출력을 보려면 '실행'을 클릭하세요.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Read a snack and a price. Put a price tag like apple: 3 coins in the STRING Tag, then output Tag.
출력을 보려면 '실행'을 클릭하세요.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
Read a name and an age. Output Next year Kit is 3. Work out Age + 1 inside NUM_TO_STR.
출력을 보려면 '실행'을 클릭하세요.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
Read a name, a kind and a number of nights. Output a 3-line card: Name: Kit, then Kind: fox, then Nights: 12/30.
출력을 보려면 '실행'을 클릭하세요.