Getting Started with Python: Introducing Python!
I am studying Python with @skillcrush, in this article we cover an introduction to python!
I am learning with Skillcrush. Please check them out and sign up if you're looking to break into tech!
Receive $250 off your course by using the link above. Use the coupon code: TWIXMIXY
NOTE: this discount is for Break Into Tech + Get Hired package exclusively.
It's the same program I am participating in!
🐍 Greetings travelers! We are studying Python with Skillcrush. In this article we cover an introduction to python.
⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0% DONE
I’ve wrapped up my Front End Developer portfolio at Skillcrush, read here:
I am now enrolled at UC Berkeley! 🏫 I will be taking their Full Stack MERN Coding Bootcamp through the remainder of the year.
You can subscribe without signing up for a substack account! Also just select “None” when subscribing. All the content from my learning journey is free.
Let’s go Snake! 🐍
It was actually named after Monty Python tho.
Python is a general purpose language and can be used for many things:
Web development
Data analysis
Machine learning
Game programming
File processing
For this course we will not be covering machine learning or game programming.
Python is open source, meaning anyone can use it.
Computational Thinking is the way computers think and solve problems through code.
Four Computational Thinking Principles:
Decomposition
Pattern recognition
Abstraction
Algorithm writing
→ DECOMPOSITION
the process of taking a large problem & breaking it down into smaller problems that area easier to solve
→ PATTERN RECOGNITION
looking for similarities among the smaller problems identified in the decomposition step
→ ABSTRACTION
finding a simplified version of the problem to solve & ignoring the extra details
→ ALGORITHM WRITING
creating the instructions or code the computer will follow in order to solve the problem
Replit
Kind of like CodeSandbox, this is a platform to build python code and test it.
Class Project
For us to practice building in Python we are given a project. This project will be to create a personal assistant app. The goal is to have the personal assistant app create and store to-do lists, personal contacts, and important birthdays.
Setting Up Replit Workspace
The lesson walks us through how to create our first replit workspace.
Building Variables & Data Types
→ VARIABLES
Containers that store the information you use in your code
→ DATA TYPES
The kind of information you store in your variables - such as a number or text
To use variables and data types successfully:
Write variables
Select different types of data
Modify data
Most common Data Types:
strings
integers
floats
→ STRINGS
Series of characters that can include letters, numbers, and symbols. Strings will have quotes around them to define the beginning and end of the string.
→ INTEGERS
Any whole number like 0, -1, 25, and 1990. Integers do not require quotes.
→ FLOATS
Data type that is used only for numbers with a decimal. Used when precision matters.
*~*~*
→ ARITHMETIC OPERATORS
Symbols that represent math operations, like addition (+), subtraction (-), multiplication (*), and division (/).
→ CONCATENATING
Computer science term that means to join.
→ REPETITION OPERATOR
Uses multiplication symbol to repeat a string over and over.
Naming Variables
Lowercase - always lowercase variable names. Uppercase isn’t wrong per se, but it’s not typical for Python.
Underscore between words - No spaces allowed. Not conventional to do camelCase either. It’s easier to read and common place in Python.
Descriptive - The name should describe the purpose of the variable. This way any coder can quickly understand the role of the variable.
Reserved Words
These names cannot be used as variable names. They are keywords used in Python to identify other coding elements and to perform operations. If used, the code will not run.
and, as, assert, break, class, continue, def, del, elif, else, except, False, finally, for, from, global, if, import, in, is, lambda, None, nonlocal, not, or, pass, raise, return, True, try, while, with, yield
Read more here about Reserved Words.
Comments
In Python comments start with a number/hash sign (#). The sign tells the code editor to ignore the characters after it when the code is run.
Python Challenges
My First Variable
Time for a coding challenge, where we are going to build our first Python variable. Skillcrush gives challenges along the way. I’ll share my results here with you! However I highly recommend signing on with their program or one that works within your budget.
Math with Python
Now time to dive into some math and arithmetic.
🟩🟩⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 14% DONE
I’ve loved beginning to learn Python! Now that I have done work in both JavaScript and PHP I could see how once you learn one language it can be easier to adapt it to others. In the next article about Python we will cover control structures and functions.
What did you think? Leave me a comment and share!