Programming in Python
As you learn Python throughout this course, there are a few things you should keep in mind.
1. Python is case sensitive.
2. Spacing is important.
3. Use error messages to help you learn.
Introduction to python and Data
Basic Elements
Data Types and Structure
Control Flow
Conditionals and loops
Functions
Applying python to Data Science
Scripting
NumPy Pandas
In this course, you will first learn how to write basic Python statements using building blocks
like the print statement, variables, and different data types. You will then look into ways to
group and order data types into different data structures. With an understanding of how data is
structured and organized in programming, you will then control the flow of your code with
conditionals, loops, and functions. Then, in the Scripting lesson, you will combine all the
concepts you’ve learned and write and run code in your local environment. Lastly, you will learn
to apply Python to Data Science, using some pre-built collections of code, or packages. These
include NumPy, a package for efficient scientific computation, and pandas, a popular data
science package for manipulating data that’s built on top of NumPy.
Let's dive right in!
Data Types and Operators
In this lesson, you will learn how to write basic Python statements using building blocks like the
print statement, variables, and different data types.
Here are the topics you'll learn about:
Data Types: Integers, Floats, Booleans, Strings
Operators: Arithmetic, Assignment, Comparison, Logical
Built-In Functions, Type Conversion
Whitespace and Style Guidelines
Print Statements
print () - built-in function that displays input values as text in the output
Arithmetic Operators
Arithmetic operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Mod (the remainder after dividing)
** Exponentiation (note that ^ does not do this operation, as you might have seen in other
languages)
// Divides and rounds down to the nearest integer
The usual order of mathematical operations holds in Python, often referred to
as PEMDAS: Parentheses, Exponents, Multiplication/Division, Addition/Subtraction.