You are on page 1of 1

Output Input Selection

Use print() to output to the screen. Comma-separate strings and values. Use input() to ask the user to enter a value. Store it in a variable. if...elif…else statements are used to choose which code to run,
depending on a Boolean expression.

The input() subroutine always returns a string. If you need the data as a
number, then you must convert it using casting.
Mathematical Operators
else: is used for code that runs if the Boolean expression is not met

Casting
These subroutines allow you to convert between data types.
Escape Sequences
Escape sequences are used to print otherwise unprintable characters
such as line breaks, tabs, backspaces and quotes.

elif: is used to check additional Boolean expressions

Variables and Constants


Variable names must be descriptive. They cannot start with a digit or
contain punctuation other than underscores. They should not start with a
capital letter. Constant names should be in UPPERCASE
1. Basics to Selection

Booleans Nested Selection


A Boolean is a datatype that can store True or False. You can have if statements inside each other. Be careful with indentation.

Maths Functions and Libraries


In-built mathematical functions

Created by @RebeccaDCruzEdu
Boolean operators can be used to combine Boolean expressions.

Libraries are collections of code that you can import into your program
when you need them.

You might also like