Startik Startik
Guest
Startik-KR
Go home
Log out
Your browser does not support video.
1 00:00:00,000 --> 00:00:05,000 Python fundamentals with Artificial Intelligence 2 00:00:05,000 --> 00:00:08,000 Python control statements and practice 3 00:00:08,000 --> 00:00:14,000 This is a session to understand and practice Python’s basic control statements: if, for, and while. 4 00:00:14,000 --> 00:00:18,000 You will learn essential elements for implementing complex algorithms. 5 00:00:18,000 --> 00:00:23,000 Today, in the fifth Python lecture, we’ll cover control statements, collections, and collection methods, 6 00:00:23,000 --> 00:00:27,000 working through various topics with hands-on practice. 7 00:00:27,000 --> 00:00:37,000 In control statements, we’ll learn conditionals and loops, and in collections, we’ll take a closer look at lists, tuples, sets, and dictionaries. 8 00:00:37,000 --> 00:00:41,000 We’ll also learn how to use collection methods. 9 00:00:41,000 --> 00:00:43,000 Let’s review control statements. 10 00:00:43,000 --> 00:00:49,000 Control statements are the core structures that control the flow of execution in a program. 11 00:00:49,000 --> 00:00:52,000 They consist of conditionals and loops. 12 00:00:52,000 --> 00:00:55,000 First, the if statement among conditionals. 13 00:00:55,000 --> 00:01:00,000 It performs branching to execute different code depending on the condition. 14 00:01:00,000 --> 00:01:02,000 while and for loops 15 00:01:02,000 --> 00:01:10,000 They repeatedly execute code while a certain condition is satisfied, or repeat according to a sequence or range. 16 00:01:10,000 --> 00:01:16,000 The range function is a useful function that creates a sequence of integers as needed. 17 00:01:16,000 --> 00:01:19,000 Next are other control statements. 18 00:01:19,000 --> 00:01:22,000 Now it’s time to learn about the remaining control statements. 19 00:01:22,000 --> 00:01:26,000 These include the break statement, continue statement, and pass statement. 20 00:01:26,000 --> 00:01:31,000 These commands help you control code more flexibly. 21 00:01:31,000 --> 00:01:35,000 The break statement forcibly terminates a loop, 22 00:01:35,000 --> 00:01:40,000 and the continue statement skips the current iteration and moves on to the next one. 23 00:01:40,000 --> 00:01:46,000 And the pass statement executes nothing—in other words, it simply passes. 24 00:01:46,000 --> 00:01:50,000 The next topic is collections. 25 00:01:50,000 --> 00:01:55,000 We’re going to deal with lists, tuples, sets, and dictionaries. 26 00:01:55,000 --> 00:02:02,000 A list is a sequence data type that allows duplicate values and supports adding, modifying, and deleting elements. 27 00:02:02,000 --> 00:02:08,000 A tuple is similar to a list, but it is read-only. 28 00:02:08,000 --> 00:02:13,000 A set does not allow duplicate values, and you can add and remove elements. 29 00:02:13,000 --> 00:02:19,000 Lastly, a dictionary is a non-sequence data type made up of key–value pairs. 30 00:02:19,000 --> 00:02:26,000 We’ll look at each collection in more detail and see how it can be used. 31 00:02:26,000 --> 00:02:31,000 Lastly, it’s time to learn about collection methods. 32 00:02:31,000 --> 00:02:36,000 It’s important to understand the difference between functions and methods. 33 00:02:36,000 --> 00:02:41,000 Functions are used on their own, and methods are used together with an object. 34 00:02:42,000 --> 00:02:47,000 There are various methods that can be applied to lists, tuples, and sets. 35 00:02:47,000 --> 00:02:53,000 Using these methods, you can manage collections more efficiently. 36 00:02:53,000 --> 00:02:56,000 Assignment guide and wrap-up 37 00:02:56,000 --> 00:03:01,000 Based on what you learned today, try a few assignments. 38 00:03:01,000 --> 00:03:07,000 These assignments will help you practice and internalize the concepts we covered today. 39 00:03:07,000 --> 00:03:12,000 Practicing calculating an average, using lists and sets, and calculating Python scores, etc., 40 00:03:12,000 --> 00:03:17,000 work through various problems to deepen your understanding. 41 00:03:17,000 --> 00:03:25,000 For student score calculation, write a program that takes multiple students’ scores as input and calculates and prints the total and average. 42 00:03:25,000 --> 00:03:29,000 Python’s control statements offer a variety of features. 43 00:03:29,000 --> 00:03:38,000 The break statement forcibly terminates a loop, and the continue statement skips the current iteration and moves on to the next one. 44 00:03:38,000 --> 00:03:44,000 Also, the pass statement is a command that does nothing, allowing you to add code later. 45 00:03:44,000 --> 00:03:49,000 In this example, we use a nested for-loop to print the multiplication table. 46 00:03:49,000 --> 00:03:56,000 The outer loop repeats from the 1-times table to the 9-times table, and the inner loop prints the products in each table. 47 00:03:57,000 --> 00:04:10,000 To print each table’s multiplication results neatly, we used print("-------------") to insert a separator line between the tables. 48 00:04:10,000 --> 00:04:15,000 We also practiced adding and removing elements in a set. 49 00:04:15,000 --> 00:04:21,000 Finally, we learned how to work with key–value pairs in dictionaries. 50 00:04:21,000 --> 00:04:28,000 We calculate and print the average of the tuple (43, 55, 63, 20, 91). 51 00:04:28,000 --> 00:04:34,000 Using the list [1, 2, 2, 3, 4, 4], we perform various operations. 52 00:04:34,000 --> 00:04:40,000 We take the Python scores of five students as input, then calculate and print the total and average. 53 00:04:40,000 --> 00:04:44,000 That’s it for today’s class. 54 00:04:44,000 --> 00:04:49,000 If you have any questions about the lesson, feel free to ask anytime. 55 00:04:49,000 --> 00:04:51,000 Thank you.

Python Basics with Artificial Intelligence


Lecture Overview and Learning Objectives

  • Understand how basic Python control statements (if, for, while) work and how to use them
  • Practice conditional and loop structures for implementing complex algorithms
  • Learn the characteristics and usage of collection data types (list, tuple, set, dictionary)
  • Practice managing data efficiently using collection methods

Control Statements: Conditionals and Loops

  • Control statements: Structures that branch or repeat the program’s execution flow depending on conditions
  • if statement: Branch processing that executes different code depending on a condition
  • while statement: Repeatedly executes code while a given condition is true
  • for statement: Repeats a fixed number of times over a sequence (such as a list) or a range
  • range() function: Generates an integer sequence of the required length for use in loops

Other Control Statements: break, continue, pass

  • break: Immediately terminates the current loop
  • continue: Skips the current iteration and proceeds to the next
  • pass: Performs no action, used as a placeholder for code to be added later
  • Used to precisely control execution flow in complex loop structures

Characteristics of Collection Data Types

  • list: Allows duplicates, ordered, can be added to, modified, and deleted
  • tuple: Similar to a list, but read-only (cannot be modified)
  • set: Does not allow duplicates, order is not guaranteed, elements can be added and removed
  • dictionary: A non-sequence data type composed of key–value pairs
  • Understand the structure and features of each collection and choose the right one for each situation

Collection Methods and Their Use

  • Function: A block of code that is called and used independently
  • Method: A function that belongs to a specific object (e.g., list, tuple, set) and manipulates that object
  • Improve data management efficiency using various methods applicable to list, tuple, and set
  • Practice such as adding/removing set elements and accessing/modifying dictionary key–value pairs

Practice Examples and Assignments

  • Print the multiplication table using nested for loops (including separators between each set of tables)
  • Practice adding/removing set elements and handling dictionary key–value pairs
  • Write a program that calculates the average of given tuple scores
  • Practice processing data that includes duplicates using a list
  • Implement a program that takes multiple students’ scores as input and calculates total and average
  • Reinforce concepts by combining control statements and collections to solve real-world problems
Guest 과정
인공지능과 함께하는 파이썬 기초
학습 인공지능과 함께하는 파이썬 기초   Current content
Video mov.mp4
Targeting of HIF2-driven cachexia in kidney cancer
학습 Targeting of HIF2-driven cachexia in kidney cancer   Completed content
Webpage https://www.nature.com/articles/s41591-025-04054-2
중국어 회화
학습 중국어 회화   Completed content
Video 중국어.mp4
Steve Jobs' 2005 Stanford Commencement Address
학습 Steve Jobs' 2005 Stanford Commencement Address   Completed content
Audio Steve Jobs' 2005 Stanford Commencement Address.mp3
Javascripts와 Typescript를 모두 배우는 게 좋을까요
Discussion Javascripts와 Typescript를 모두 배우는 게 좋을까요   Completed content
Javascripts와 Typescript를 모두 배우는 게 좋을까요
파이썬 퀴즈
آزمون 파이썬 퀴즈   Completed content
인공지능과 함께하는 파이썬 기초
수학 손 글씨, 그래프
학습 수학 손 글씨, 그래프   Completed content
Document 손글씨.pdf
대한민국헌법 (헌법재판소)
학습 대한민국헌법 (헌법재판소)   Completed content
Document 헌법소책자(국문_해설포함형).pdf
수능특강 수학영역 I
학습 수능특강 수학영역 I   Completed content
Document 2022 EBS수능특강_수학Ⅰ_본문(학생용).pdf
These animals are also plants
학습 These animals are also plants   Completed content
Video These animals are also plants … wait, what_ - Luka Seamus Wright.mp4
폭력 그리고 법, 달라지는 판례
학습 폭력 그리고 법, 달라지는 판례   Completed content
Video (클립4) 폭력 그리고 법, 달라지는 판례_최종.mp4
수학 미분법
학습 수학 미분법   Completed content
Document [동아 미적분] 04 여러 가지 미분법.pdf
2028 대학입시제도 개편안에 따른 통합사회·통합과학 예시문항 안내 ★
학습 2028 대학입시제도 개편안에 따른 통합사회·통합과학 예시문항 안내 ★   Completed content
Document 2028 대학입시제도 개편안에 따른 통합사회·통합과학 예시문항 안내 ★.pdf
Startik 소개
학습 Startik 소개   Completed content
Document startik.pdf
고등학교 논술
학습 고등학교 논술   Completed content
Video 64a8b9968d8e4679.mp4
대한민국 헌법
آزمون 대한민국 헌법   Completed content
대한민국헌법 (헌법재판소)
2026학년도 3월학기 외국인 신입생 모집요강
학습 2026학년도 3월학기 외국인 신입생 모집요강   Completed content
Document 2026학년도 3월학기 외국인 신입생 모집요강_0123.pdf
Startik-KR
Q&A Startik-KR   Completed content
Document Startik-KR.pdf