Professional Documents
Culture Documents
Python Basics 1
Python Basics 1
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.
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.