Night 30: Show the world
Вы уже прошли этот вечер на Python или псевдокоде. Он засчитывается для обоих языков. При желании можете потренироваться ещё раз.
Tonight: show the world
- This is night 30! Finish it, and your pet becomes a star.
- Tonight you make a card to show what you and your pet can do.
Words for tonight
| Word | Meaning |
|---|---|
| share | show something to other people |
| card | a small, nice page with some facts |
| proud | happy about something good that you did |
Look how far you came
| Week | You learned |
|---|---|
| 1 | print, variables, input(), numbers, if, lists, for |
| 2 | while, random, functions, parameters, return |
| 3 | text tools, f-strings, dictionaries, sum, min, max |
| 4 | nested loops, 2D lists, a game loop, try, clean code |
| 5 | your own pet game |
One more tool: join
", ".join(items)puts,between the items of a list.
toys = ["ball", "kite", "box"]
print("Toys: " + ", ".join(toys))
print(" - ".join(toys))
A frame that fits
- The size of the frame comes from
len(name), so it fits every name.
name = "Lumi"
border = "*" * (len(name) + 4)
print(border)
print("* " + name + " *")
print(border)
What next?
- Go back to your hub: your pet's card is ready to save and share.
- Want more? The full Python Basics course goes deeper into every idea.
- Keep coding a little every day. Ten minutes a night is how you learned all this!
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
Make your pet's star card. Read a name and a kind. Print 4 lines: *** 30 Code Nights ***, Name: Kit, Kind: fox, Nights: 30/30.
Нажмите Запустить, чтобы увидеть результат здесь.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
Show what you learned. Use ", ".join(skills) to print I can use: print, loops, if, functions.
Нажмите Запустить, чтобы увидеть результат здесь.
Сложность 2/5 · 140 монет + небольшой бонус за первое завершение сегодня
Define certificate(name). It returns Kit finished 30 Code Nights! for Kit. Print it for your pet.
Нажмите Запустить, чтобы увидеть результат здесь.
Сложность 3/5 · 200 монет + небольшой бонус за первое завершение сегодня
Put a name in a frame of stars. Read a name. The top and bottom lines have len(name) + 4 stars. The middle line is * Kit *.
Нажмите Запустить, чтобы увидеть результат здесь.