Git Product home page Git Product logo

cs50p's Introduction

Harvard CS50P 2022 Solutions

An introduction to programming using a language called Python. Learn how to read and write code as well as how to test and โ€œdebugโ€ it. Designed for students with or without prior programming experience whoโ€™d like to learn Python specifically. Learn about functions, arguments, and return values (oh my!); variables and types; conditionals and Boolean expressions; and loops. Learn how to handle exceptions, find and fix bugs, and write unit tests; use third-party libraries; validate and extract data with regular expressions; model real-world entities with classes, objects, methods, and properties; and read and write files. Hands-on opportunities for lots of practice. Exercises inspired by real-world programming problems. No software required except for a web browser, or you can write code on your own PC or Mac.

Screenshots ๐Ÿ–ผ๏ธ

App Screenshot

Week 0 - Functions, Variables ๐Ÿงฉ

Functions. Arguments. Side Effects. Bugs. Return Values. Variables. Comments. Pseudocode. str. Parameters. int. Operators. Interactive Mode. float. def. Scope. return.

Week 1 - Conditionals ๐Ÿšฅ

if. elif. else. or. and. bool. match.

Week 2 - Loops โžฟ

while. for. list. range. continue. break. list. len. dict. None.

Week 3 - Exceptions โ›”

SyntaxError. ValueError. try. except. NameError. else. pass. raise.

Week 4 - Libraries ๐Ÿ“–

Modules. random. import. from. statistics. Command-Line Arguments. sys. sys.argv. IndexError. sys.exit. Slices. Packages. PyPI. pip. cowsay. APIs. requests. JSON. name.

Week 5 - Unit Tests ๐Ÿงจ

assert. AssertionError. pytest. Packages. init.py.

Week 6 - File I/O ๐Ÿ“‚

list. open. with. sorted. CSV. dict. csv. PIL.

Week 7 - Regular Expressions ๐ŸŽญ

Regular Expressions. Regexes. re. re.search. re.match. re.fullmatch. re.sub. re.split. re.findall.

Week 8 - Object-Oriented Programming ๐Ÿ’ป

tuple. Classes. class. Objects. Attributes. Instance Variables. Methods. Instance Methods. init. raise. str. Properties. @property. Decorators. int. str. str.lower. str.strip. list. list.append. dict. Class Methods. @classmethod. Static Methods. @staticmethod. Inheritance. BaseException. Operator Overloading. object.add.

Week 9 - Et Cetera โ™พ๏ธ

docs.python.org. set. global. Constants. Type Hints. mypy. Docstrings. peps.python.org. argparse. Unpacking. *args. **kwargs. print. map. List Comprehensions. filter. Dictionary Comprehensions. enumerate. Generators. yield. Iterators.

Final Project ๐Ÿ“ƒ

Once you have solved each of the courseโ€™s problem sets, itโ€™s time to implement your final project, a Python program of your very own! The design and implementation of your project is entirely up to you, albeit subject to these requirements:

  • Your project must be implemented in Python.
  • Your project must have a main function and three or more additional functions. At least three of those additional functions must be accompanied by tests that can be executed with pytest.
    • Your main function must be in a file called project.py, which should be in the โ€œrootโ€ (i.e., top-level folder) of your project.
    • Your 3 required custom functions other than main must also be in project.py and defined at the same indentation level as main (i.e., not nested under any classes or functions).
    • Your test functions must be in a file called test_project.py, which should also be in the โ€œrootโ€ of your project. Be sure they have the same name as your custom functions, prepended with test_ (test_custom_function, for example, where custom_function is a function youโ€™ve implemented in project.py).
    • You are welcome to implement additional classes and functions as you see fit beyond the minimum requirement.
  • Implementing your project should entail more time and effort than is required by each of the courseโ€™s problem sets.
  • Any pip-installable libraries that your project requires must be listed, one per line, in a file called requirements.txt in the root of your project.

Project

CS50 Certificate ๐Ÿ“‘

Certificate

License ๐Ÿ“

Licenรงa

A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

signature
like

cs50p's People

Contributors

vncsmnl avatar

Stargazers

 avatar

Watchers

 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.