CS50P - Lecture 0 - Functions, Variables

CS50 July 8, 2022
Video Thumbnail

About

No channel description available.

Video Description

This is CS50P, CS50's Introduction to Programming with Python. Enroll for free at https://cs50.edx.org/python. Slides, source code, and more at https://cs50.harvard.edu/python. Playlist at https://www.youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V. TABLE OF CONTENTS 00:00:00 - Introduction 00:00:24 - hello.py 00:03:19 - Command-line Interface 00:04:00 - Python Interpreter 00:05:06 - Functions, Arguments, Side Effects 00:07:35 - Bugs and Debugging 00:09:54 - VS Code and Integrated Development Environments (IDEs) 00:12:16 - Return Values and Variables 00:19:56 - Comments and Pseudocode 00:25:05 - Multiple Function Arguments 00:31:01 - Named Parameters 00:40:48 - Escaping Characters 00:43:10 - f-Strings 00:45:04 - String Methods 00:54:43 - Style 00:57:50 - split 00:59:35 - Integers and Operators 01:03:13 - calculator.py 01:06:25 - Type Conversion 01:14:36 - Floating Point Values 01:19:18 - Numeric Formatting 01:22:47 - Division 01:26:14 - Defining Functions 01:39:01 - Scope 01:41:17 - Return Values 01:45:11 - 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! *** HOW TO SUBSCRIBE http://www.youtube.com/subscription_center?add_user=cs50tv HOW TO TAKE CS50 edX: https://cs50.edx.org/ Harvard Extension School: https://cs50.harvard.edu/extension Harvard Summer School: https://cs50.harvard.edu/summer OpenCourseWare: https://cs50.harvard.edu/x HOW TO JOIN CS50 COMMUNITIES Discord: https://discord.gg/cs50 Ed: https://cs50.harvard.edu/x/ed Facebook Group: https://www.facebook.com/groups/cs50/ Faceboook Page: https://www.facebook.com/cs50/ GitHub: https://github.com/cs50 Gitter: https://gitter.im/cs50/x Instagram: https://instagram.com/cs50 LinkedIn Group: https://www.linkedin.com/groups/7437240/ LinkedIn Page: https://www.linkedin.com/school/cs50/ Medium: https://cs50.medium.com/ Quora: https://www.quora.com/topic/CS50 Reddit: https://www.reddit.com/r/cs50/ Slack: https://cs50.edx.org/slack Snapchat: https://www.snapchat.com/add/cs50 SoundCloud: https://soundcloud.com/cs50 Stack Exchange: https://cs50.stackexchange.com/ TikTok: https://www.tiktok.com/@cs50 Twitter: https://twitter.com/cs50 YouTube: http://www.youtube.com/cs50 HOW TO FOLLOW DAVID J. MALAN Facebook: https://www.facebook.com/dmalan GitHub: https://github.com/dmalan Instagram: https://www.instagram.com/davidjmalan/ LinkedIn: https://www.linkedin.com/in/malan/ Quora: https://www.quora.com/profile/David-J-Malan TikTok: https://www.tiktok.com/@davidjmalan Twitter: https://twitter.com/davidjmalan *** CS50 SHOP https://cs50.harvardshop.com/ *** LICENSE CC BY-NC-SA 4.0 Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License https://creativecommons.org/licenses/by-nc-sa/4.0/ David J. Malan https://cs.harvard.edu/malan [email protected]

You May Also Like

Coding Beginner's Kit Essentials

AI-recommended products based on this video

Loading...
Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

(382)
$94.95
PrimeFREE delivery Sat, Jun 14
Loading...
10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

(1)
$99.99
FREE delivery Mon, Aug 11
Loading...
ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

(49)
$117.29$102.21
$6.86 delivery Thu, Aug 14
Loading...
7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

(61)
$68.99
FREE delivery Tue, Aug 12
Loading...
BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

(288)
$54.14
FREE delivery Sun, Jun 22
Loading...
Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Noise-Cancelling Mic and LED Display, Built-in Mic for Clear Calls, Waterproof Design for Sports

Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Noise-Cancelling Mic and LED Display, Built-in Mic for Clear Calls, Waterproof Design for Sports

(8)
$39.99
FREE delivery Tue, Nov 4
Loading...
Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Powerful Bass, Built-in Noise-Cancelling Mic for Clear Calls, LED Display, 36H Playtime, IPX5 Waterproof Design for Sports

Monster N-Lite 211 Wireless Earbuds, Bluetooth 6.0 Stereo Headphones with Powerful Bass, Built-in Noise-Cancelling Mic for Clear Calls, LED Display, 36H Playtime, IPX5 Waterproof Design for Sports

(40)
$39.99
FREE delivery Thu, Nov 13
Loading...
MOSISO 360 Protective Laptop Bag 15 inch, 15 inch Computer Shoulder Bag Compatible with MacBook Air 15 M4 M3 M2 2025-2023, Dell XPS 15, Side Open Messenger Case &4 Zipper Pockets&Handle, Black Global Recycled Standard

MOSISO 360 Protective Laptop Bag 15 inch, 15 inch Computer Shoulder Bag Compatible with MacBook Air 15 M4 M3 M2 2025-2023, Dell XPS 15, Side Open Messenger Case &4 Zipper Pockets&Handle, Black Global Recycled Standard

(3,362)
$39.32
FREE delivery Tue, Jun 17
Loading...
WINDARS WINDARS Backpack for School Girls, Cute High School Backpacks for Teens Women Student Large Bookbag 15.6 Inch Laptop Bag with USB Charger Port for College Work Travel Trip (Beige Khaki)

WINDARS WINDARS Backpack for School Girls, Cute High School Backpacks for Teens Women Student Large Bookbag 15.6 Inch Laptop Bag with USB Charger Port for College Work Travel Trip (Beige Khaki)

(70)
$40.99
PrimeFREE delivery Sat, Jun 14
Loading...
RAINSMORE Laptop Bag for Women 15.6 inch Laptop Tote Bag Leather Large Capacity Work Tote Bag Waterproof Business Office Computer Bag Women Travel Handbag Shoulder Bag, Pink

RAINSMORE Laptop Bag for Women 15.6 inch Laptop Tote Bag Leather Large Capacity Work Tote Bag Waterproof Business Office Computer Bag Women Travel Handbag Shoulder Bag, Pink

(397)
$49.99
PrimeFREE delivery Sat, Jun 14
Loading...
MOSISO Laptop Case 13 inch, 13 inch Laptop Sleeve Bag Compatible with MacBook Air 13 M4 M3 M2 M1 2025-2018 / Pro 13 M2 M1 2025-2016, Neoprene Computer Sleeve Bag with Small Case, Space Gray Global Recycled Standard

MOSISO Laptop Case 13 inch, 13 inch Laptop Sleeve Bag Compatible with MacBook Air 13 M4 M3 M2 M1 2025-2018 / Pro 13 M2 M1 2025-2016, Neoprene Computer Sleeve Bag with Small Case, Space Gray Global Recycled Standard

(20,392)
$24.29$21.88
FREE delivery Sun, Aug 10 on your first order
Loading...
NA to Clamp, Quick Release NA to Rail Lock Clamp with 1/4in 3/8in Thread, Standard NA to Clamp Adapter for Camera Cage Friction Arm Ball Head Cold Shoe Microphone Monitor

NA to Clamp, Quick Release NA to Rail Lock Clamp with 1/4in 3/8in Thread, Standard NA to Clamp Adapter for Camera Cage Friction Arm Ball Head Cold Shoe Microphone Monitor

(0)
$12.69
FREE delivery Jun 27 - Jul 10
Loading...
HLDIRECT 47 Inch Gaming Desk with LED Lights, Home Office Gamer Desk, Ergonomic Computer Table with Large Carbon Fiber Desktop, Computer Desk with Cup Holder & Headphone Hook for Home Office, Black

HLDIRECT 47 Inch Gaming Desk with LED Lights, Home Office Gamer Desk, Ergonomic Computer Table with Large Carbon Fiber Desktop, Computer Desk with Cup Holder & Headphone Hook for Home Office, Black

(591)
$107.99
FREE delivery Thu, Jun 26
Loading...
FOYTOKI 2 Sets Rechargeable Hand Warmers Portable with Temperature Levels Ergonomic Design for School Office

FOYTOKI 2 Sets Rechargeable Hand Warmers Portable with Temperature Levels Ergonomic Design for School Office

(0)
$14.15
FREE delivery Jul 2 - 22
Loading...
IMGadgets 47 x 24 Inches Height Adjustable Electric Standing Desk 2024, 5th Gen Quieter Motor Ergonomic Sit Stand Up Home Office Computer Desk with Height Memory Buttons, Display, 2 Headphone Holders
Best Seller

IMGadgets 47 x 24 Inches Height Adjustable Electric Standing Desk 2024, 5th Gen Quieter Motor Ergonomic Sit Stand Up Home Office Computer Desk with Height Memory Buttons, Display, 2 Headphone Holders

(438)
$169.95
FREE delivery Thu, Jun 26
200+ bought in past month
Loading...
SEVEN WARRIOR Gaming Desk with LED Lights & Power Outlets, 55" Computer Desk with Monitor Shelf, Home Office Desk with Cup Holder and Headphone Hook, Ergonomic, Carbon Fiber Surface Black

SEVEN WARRIOR Gaming Desk with LED Lights & Power Outlets, 55" Computer Desk with Monitor Shelf, Home Office Desk with Cup Holder and Headphone Hook, Ergonomic, Carbon Fiber Surface Black

(693)
$109.99
FREE delivery Thu, Jun 26
Loading...
Expo Dry Erase Markers, Whiteboard Markers with Low Odour Ink, Chisel Tip, Assorted Colours, 4 Count

Expo Dry Erase Markers, Whiteboard Markers with Low Odour Ink, Chisel Tip, Assorted Colours, 4 Count

(42,242)
$5.48
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month
Loading...
Dry Erase Markers Low Odor Fine Whiteboard Markers Thin Box of 12,10 Colors
Best Seller

Dry Erase Markers Low Odor Fine Whiteboard Markers Thin Box of 12,10 Colors

(46,489)
$9.98
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month
Loading...
HQCME 9 Pack Lined Sticky Notes, 4X6 in, 9 Pastel Colors Large Ruled Stickies Colorful Super Sticking Power Memo Pads Strong Adhesive, Sticky Notes with Lines for Home, Office

HQCME 9 Pack Lined Sticky Notes, 4X6 in, 9 Pastel Colors Large Ruled Stickies Colorful Super Sticking Power Memo Pads Strong Adhesive, Sticky Notes with Lines for Home, Office

(1,909)
$10.99
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month