SDU University CSS 115: Python Programming Fundamentals Fall 2024 Lecture 4 PDF

Summary

This lecture from SDU University's CSS 115 course covers Python programming fundamentals, specifically conditional statements (if, elif, else). The lecture introduces the concept of control flow and how to use conditional statements to execute different code blocks based on specific conditions.

Full Transcript

CSS 115 - Programming Fundamentals 1 (Python) Fall 2024 Lecture 4 Plan Python statements Part 1: if elif else Questions Moodle https://moodle.sdu.edu.kz/course/view.php?id=229 if, elif, else statemen...

CSS 115 - Programming Fundamentals 1 (Python) Fall 2024 Lecture 4 Plan Python statements Part 1: if elif else Questions Moodle https://moodle.sdu.edu.kz/course/view.php?id=229 if, elif, else statemens Control Flow We often only want certain code to execute when a particular condition has been met. For example, if my dog is hungry (some condition) ,then I will feed the dog (some action). To control this flow of logic we use some keywords: if elif else Control Flow syntax make use of colons (:) and indentation (whitespace in russian отступы) The indentation system is crucial to Python and is what sets it apart from other programming languages. Syntax of an if statement if some_condition: # execute some code if some_condition: # execute some code else: # do something else if some_condition: # execute some code elif some_other_condition: # do something different else: # do something else Additional Lectures Python Conditional Exrcution

Use Quizgecko on...
Browser
Browser