Git Product home page Git Product logo

python-exercises's Introduction

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

📊  There are currently 86 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
Running Sum 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
Print Order 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
What exception is raised? - Level 1 Exercise Solution
What exception is raised? - Level 2 Exercise Solution
Bound To It 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.

True or False? As opposed to variables, attributes can't contain any Python object, only several selected types

False. Like variables, attributes can contain any Python object.

Strings

How to convert "2 0 1 7" to the list [2, 0, 1, 7]?
[int(i) for in in "2 0 1 7".split()]

Lists

How to remove duplicates from a given list?

python-exercises's People

Contributors

bregman-arie avatar

Watchers

Emre ATES avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.