Skip to content
/ CS50P Public

๐Ÿ This is CS50's Introduction to Programming with Python Solutions

License

Notifications You must be signed in to change notification settings

vncsmnl/CS50P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages