Skip to content

Latest commit

 

History

History
263 lines (206 loc) · 13.3 KB

README.md

File metadata and controls

263 lines (206 loc) · 13.3 KB

ℹ️  This repo contains questions and exercises to learn and practice Python

📊  There are currently 77 exercises and questions

Exercises

Hello World

Name Objective & Instructions Solution Comments
Hello World! Exercise Solution](solutions/hello_world/hello_world.md
Python Characteristics Exercise Solution
What is the result? - Level 1 Exercise Solution
What is the result? - Level 2 Exercise

Objects & Data Types

Name Objective & Instructions Solution Comments
Objects 101 Exercise Solution
Data Types? I know a few Exercise Solution
Choose a Data Type - level 1 Exercise Solution
Choose a Data Type - level 2 Exercise Solution
Mutability Exercise Solution
Strongly Typed Exercise Solution
Object Creation Exercise Solution

Variables

Name Objective & Instructions Solution Comments
Valid Names Exercise Solution
Locations or Names Exercise Solution
Types Exercise Solution
Multiple Value Assignment Exercise Solution
Copying Variables Exercise Solution
Mutable Objects Exercise Solution

Booleans

Name Objective & Instructions Solution Comments
True or False? Exercise Solution
Conversion Exercise Solution

Strings

Name Objective & Instructions Solution Comments
22 times Exercise
Variables Exercise Solution
What is the result? - Level 1 Exercise Solution
What is the result? - Level 2 Exercise Solution
Starts with a letter Exercise Solution
Change Strings Exercise Solution
All Digits Exercise Solution
Removing Characters Exercise Solution
Reverse a String Exercise Solution
Compress Strings Exercise
Slicing - Level 1 Exercise Solution
Slicing - Level 2 Exercise Solution

Numbers

Name Objective & Instructions Solution Comments
What is the result? Exercise Solution
Operations - Level 1 Exercise Solution
Operations - Level 2 Exercise Solution
Bases Exercise Solution
Palindrome Exercise Solution

Lists & Tuples

Name Objective & Instructions Solution Comments
Access List Items Exercise Solution
Equal Lists Exercise Solution
Length Exercise
Append & Insert Exercise Solution
Min Max Exercise Solution
Three Biggest Items Exercise Solution
What is the result? - Level 1 Exercise Solution
What is the result? - Level 2 Exercise Solution

Dictionaries

Name Objective & Instructions Solution Comments
Facts Only Exercise Solution

Loops

Name Objective & Instructions Solution Comments
Break Out Exercise Solution
Break Out 2 Exercise Solution
Every character Exercise Solution
Stream of Numbers Exercise Solution
Refactor-1 Exercise Solution

Functions

Name Objective & Instructions Solution Comments
My First Function Exercise Solution
Calculator Exercise Solution
First Class Objects Exercise Solution

Classes

Name Objective & Instructions Solution Comments
Classes 101 Exercise Solution
Attributes Exercise Solution

OOP

Name Objective & Instructions Solution Comments
Inheritance Exercise Solution

Magic Methods

Name Objective & Instructions Solution Comments
Length Magic Method Exercise

Unit Testing

Name Objective & Instructions Solution Comments
Calculator Unit Tests Exercise Solution
Fix Calculator Unit Tests Exercise

Exceptions

Name Objective & Instructions Solution Comments
Dividing by Zero Exercise Solution
What exception is raised? - Level 1 Exercise Solution
What exception is raised? - Level 2 Exercise Solution

Regex

Name Objective & Instructions Solution Comments
Substitute Strings Exercise Solution

Files

Name Objective & Instructions Solution Comments
Read a File Exercise
Reverse a file Exercise
Print specific line Exercise

Operating Systems

Name Objective & Instructions Solution Comments
File exists Exercise
Print all the files in a directory Exercise

Improve the Code

Name Objective & Instructions Solution Comments
If True Exercise Solution
Walrus Exercise Solution
Vowel Letters Exercise Solution

Type Hinting

Name Objective & Instructions Solution Comments
Type Hinting Facts Only Exercise Solution
Pros & Cons Exercise Solution
Type Hinting 101 Exercise Solution
Type Hinting 102 Exercise Solution

Misc

Name Objective & Instructions Solution Comments
Random Number Exercise
Random Item Exercise

Questions

Hello World

How to print "Hello World"?

print("Hello World")

Classes

Define a class that does nothing
class SomeClass:
    pass

True or False? If c is an instance of a class, then in c.x = 1, x is a variable of the value 1

False. x is an attribute in the case c.x = 1

True or False? Every object in Python has attributes

True. You can think on attributes as private dictionaries but instead of accessing them with [] or .get, they are accessed by using a dot.