Premium Only Content

CS50P - Lecture 5 - Unit Tests
TABLE OF CONTENTS
00:00:00 - Introduction
00:00:24 - Unit Tests
00:01:15 - Testing calculator.py
00:10:20 - assert
00:12:18 - AssertionError
00:16:58 - pytest
00:28:38 - Categories of Tests
00:35:53 - Testing for Exceptions
00:38:13 - Side Effects and Testing
00:47:54 - Collections of Tests
00:50:16 - Conclusion
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.
Whereas CS50x itself focuses on computer science more generally as well as programming with C, Python, SQL, and JavaScript, this course, aka CS50P, is entirely focused on programming with Python. You can take CS50P before CS50x, during CS50x, or after CS50x. But for an introduction to computer science itself, you should still take CS50x!
-
43:43
CS50 Harvard
7 months agoCS50 Seminars 2024 - Lights, Data, Action!
1051 -
LIVE
Dr Disrespect
1 hour ago🔴LIVE - DR DISRESPECT - BLACK OPS 7 - GIVE ME BACK MY NUKE
716 watching -
LIVE
The Charlie Kirk Show
34 minutes agoThe Killer AG + Kav Assassin's 8 Years + The Battle of Portland | Hemingway, Davis | 10.6.2025
6,160 watching -
LIVE
Right Side Broadcasting Network
3 hours agoLIVE: White House Press Secretary Karoline Leavitt Holds a Press Briefing - 10/6/25
2,448 watching -
LIVE
Steven Crowder
3 hours ago🔴 Deport Them All: Trump Takes Fight to Leftist Chicago & Portland Over Attacks on ICE
26,469 watching -
1:01:46
The Rubin Report
1 hour agoBill Maher’s Crowd Stunned as Van Jones Gives a Brutal Message to Liberal Media
5.07K32 -
LIVE
Nerdrotic
2 hours agoHollywood Will EAT Itself | Amazon BENDS The Knee to 007 Fans - Nerdrotic Nooner 524
314 watching -
LIVE
The Shannon Joy Show
2 hours agoMoody’s: Recession Incoming! Economic Slowdown Crushing Americans while Trump builds a ballroom
198 watching -
LIVE
The Mel K Show
1 hour agoMORNINGS WITH MEL K -Armor of God: Humanity Must Choose their Destiny 10-6-25
625 watching -
LIVE
LFA TV
17 hours agoLIVE & BREAKING NEWS! | MONDAY 10/6/25
4,182 watching