Night 30: Show the world
כבר השלמתם את הערב הזה, בפייתון או בפסאודו-קוד. הוא נחשב לשניהם. תוכלו לתרגל שוב אם תרצו.
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 *.
לחץ על הרץ כדי לראות את התוצא כאן.