VARIABLES (Containers that store values), userAge = 15, playerName = "Mia", isLoggedIn = True, totalScore = 100 + 50, count = count + 1, DATA TYPES (Kinds of values stored), "Hello World" (String), 42 (Integer), 3.1415 (Float), False (Boolean), ["red", "green", "blue"] (List), SYNTAX (The grammar/rules of your language), Using a colon: after an if statement., Wrapping text in quotes " " or ' '., Using parentheses ( ) to call a function., Capitalizing True and False (Python rule)., Ending lines with a semicolon ; (Java rule)., CONTROL STRUCTURES (Decision-makers and loops), if grade >= 70:, for x in range(5):, while battery > 0:, else: (the "otherwise" path), elif score == 100: (else-if), COMMENTS (Notes for humans, ignored by the computer), # This calculates the average, // TODO: fix this later, """This function greets the user""", # BUG: this line crashes on edge cases, /* Multi-line note here */, ERRORS (Bugs that stop your program), NameError – using a variable that does not exist., SyntaxError – forgetting a closing quote., TypeError – adding a number to a string., IndexError – grabbing item #10 from a list of 5., ZeroDivisionError – dividing by zero.
0%
Let's Sort D' Building Blocks of Programming
Share
Share
by
Epssabangan
G8
Computer Programming
Creative Technologies
ICT
Computer Programming Basics - Text-Based
Edit Content
Print
Embed
More
Assignments
Leaderboard
Show more
Show less
This leaderboard is currently private. Click
Share
to make it public.
This leaderboard has been disabled by the resource owner.
This leaderboard is disabled as your options are different to the resource owner.
Revert Options
Group sort
is an open-ended template. It does not generate scores for a leaderboard.
Log in required
Visual style
Fonts
Subscription required
Options
Switch template
Show all
Open results
Copy link
QR code
Delete
Continue editing:
?