-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy path010_comments.py
79 lines (71 loc) · 3.32 KB
/
010_comments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Before you go any further:
# Our previous version of this Introduction to Programming course was not on
# GitHub Codespaces, which you are using now - it was on a different platform
# which was called Replit. We moved away from that platform for a number of
# reasons, but the content of this course has not changed.
#
# As you watch through our videos, like the one below and those coming after it,
# you will see Kay using a different interface to the one you are using - but
# don't worry! The text and code are the same, as are the programming principles
# she's teaching you, as is the way she is running the code. The only difference
# is how it looks, not how it works.
# Now, back to where we were —
# Video alternative: https://vimeo.com/954334215/cbd70ba2fa
# Hello! Welcome to programming. I will guide you through these early steps.
#
# To begin, I'd like to share with you a little quote from a writer called Italo
# Calvino, himself retelling a Chinese story:
#
# "Among Chuang-tzu's many skills, he was an expert draftsman. The king asked
# him to draw a crab. Chuang-tzu replied that he needed five years, a country
# house, and twelve servants. Five years later the drawing was still not begun.
# "I need another five years," said Chuang-tzu. The king granted them. At the
# end of these ten years, Chuang-tzu took up his brush and, in an instant, with
# a single stroke, he drew a crab, the most perfect crab ever seen."
#
# Perhaps you have come to programming because you would like to be good at it.
# Perhaps you know people, or you have heard of people, who are really
# exceptional programmers.
#
# You, very likely, are not this person yet. Like Chuang-tzu, it will take you
# many years to reach the effortless skill of an expert programmer.
#
# But every programmer has sat where you are sat, curious and willing to learn.
# They have spent many hours getting things wrong, being stuck, being confused.
# You will go through this too.
#
# Every expert sat where you are sat. What they all have in common? They kept
# going.
#
# So let's get started.
#
# What are we learning?
# =====================
#
# We're going to learn the fundamentals of the programming language Python. Most
# programming languages are quite similar, so it doesn't matter much that this
# is Python. The key ideas are the same.
#
# We're going to learn enough to succeed in the Makers interview process. The
# ideas themselves are quite simple. The complexity of programming is in the
# combination of these ideas. Here's a list of what we'll learn:
#
# * Functions (making your own programs)
# * Arithmetic (basic maths)
# * Expressions and statements (the building blocks of programs)
# * Strings (letters and words)
# * Conditionals (ifs and elses)
# * Lists (sequences of items)
# * Loops (whiles and fors)
# * Dictionaries (pairs of items)
#
# You will find exercises throughout the material, signposted with @TASK. We
# will finish the material with some extra tricky exercises for you to test your
# skills.
#
# By the way — these lines starting with the `#` character? They're called
# comments. They don't get run by Python — they're just for me to talk to you.
# You can create one yourself if you like.
# Type your name as a comment on the next line.
# Hint: if you're on a Mac, type opt + 3 to get a #
# Now open up 011_identity.py and get started with some real code!