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.

Leaderboard

Visual style

Options

Switch template

Continue editing: ?