1 of 37

Chapter

03

생성형 AI와 자료형 익히기

2 of 37

index

3.1​

Generative Learning AI and Data Types

With Python MicroPython

3.2

Variables in MicroPython

3. 3

Basic data types

3. 4

Collection data type

3. 5

2/28

3 of 37

Learning Objectives

  • Generative AI Using How to Cook it .
  • With Python MicroPython's The difference I understand .
  • MicroPython's of variables various Data type I am learning .

3/28

4 of 37

3.1 Understanding Generative AI

5 of 37

1. Generative The concept of AI and LLM

3.1 Understanding Generative AI

  • Generative AI is based on LLM (Large Language Model). Working artificial intelligence System
  • Representative Model : OpenAI's ChatGPT , Google Bard, etc.
  • given Enter Analyze Text , code , image Back generation possible
  • to note : Generative AI's The result is Error may include , and ' hallucination ' phenomenon May occur​

Generative AI

5/28

6 of 37

2. Using Chat GPT

MicroPython Coding Learning for ChatGPT use possible

3.1 Understanding Generative AI

    • In MicroPython Korea information Acquisition
    • Example program Writing and In the program Used grammar explanation
    • Example In the program Used grammar explanation
    • program In error Korea dissolvent
    • microcontroller How to use
    • new sensor How to use
    • various program library produce

Main Usage examples:

6/28

7 of 37

3.2 Python and �MicroPython

8 of 37

1. What is Python ?

3.2 Python and MicroPython

In the Netherlands Guido van Rossum​ Developed programming language​

easy Grammar and With flexibility artificial intelligence , data Analytics , Web Development gadfly extensively Used

Interpreter In a way It's running fast Development It is possible , but execution The speed relatively It may be slow

8/28

9 of 37

2. What is MicroPython ?

3.2 Python and MicroPython

Based on Python 3.x Lightweight In version , on microcontroller Executable​​

hardware Control For Exclusive library offer

Arduino environment based on C++ More intuitive by comparison Programming possible

9/28

10 of 37

11 of 37

3.3 MicroPython variable

12 of 37

1. Characteristics of MicroPython variables

3.3 MicroPython variable

Object In a way variable treatment

The user memory In management nerves Don't write Not Conveniently variable use possible

of variables The data type is automatic Decision ( dynamic Typing )

12/28

13 of 37

2. Variables name Build

3.3 MicroPython variable

Variables , functions , classes , modules or of the object name

Alphabet , uppercase and lowercase letters , numbers and Special characters Created by combining underscores ( _ )

By numbers When you start No

if, for, while, etc. same Reserved words cannot be used

meaning present name Usage : temperature_celsius = 25

Lowercase letters and Using underscore (_) : sensor_value = 100

Constant In capital letters Created by : LED_PIN = 2

identifier​

variable name How to build well

13/28

14 of 37

15 of 37

3.4 Basics Data type

16 of 37

Basic Data Types - Summary

3.4 Basics Data type

1

Python's basic In data type Includes integers ( int ), real numbers (float), strings ( str ), and booleans (bool) .

Float : No decimal point Included 32-bit floating point number Saved

Integer ( int ): No decimal point no By numbers size There is a limit doesn't exist

String ( str ): single quotes (') or Wrap it in double quotes (") expressed

2

3

4

Boolean (bool): A True or False value Have logic In operations and conditional statements Used

5

16/28

17 of 37

1. Integer ( int )

3.4 Basics Data type

1

Integer type The decimal point no Numbers Indicates , �size limits without Available for use

In the calculation Natural numbers and negative numbers Used when handling​

2

num = 100 print(type(num)) #

17/28

18 of 37

2. Float​

3.4 Basics Data type

1

The real number is decimal point Including Numbers , floating point� In the manner (IEEE 754) Saved​

The precision is Required science Operation or sensor In the data utilized​

2

num = 3.14 print(type( num )) #

18/28

19 of 37

3. String ( str )

3.4 Basics Data type

1

The string is of letters It is a set Single quotes (') or Wrap it in double quotes (") expressed​

The string is It is immutable various operation method Provided​

2

text = "Hello, world!" print(type(text)) #

19/28

20 of 37

4. Boolean (bool)

3.4 Basics Data type

1

Boolean The data type is a True or False value. Have �logic In operations and conditional statements Used​

0 is False, not 0 every The number is True evaluated​

2

flag = True print(type(flag)) #

20/28

21 of 37

22 of 37

23 of 37

24 of 37

3.5 Collection Data type

25 of 37

Collection Data Types - Summary

3.5 Collection Data type

1

Python's Collection In data type Includes lists , tuples , dictionaries , and sets​​

Tuple : List and Similar but Change Immutable data​ structure

list : several The elements Can be saved Variable data structure

Dictionary : key-value pairs Saving Data type

2

3

4

set : duplicate no The elements Saving set Operation Supporting Data type

5

25/28

26 of 37

1. List​

3.5 Collection Data type

1

The list is several The elements Can be saved Variable data structure

The order is is maintained , and indexing and Slicing Possible​

2

my_list = [10, 20, 30] my_list.append (40) print( my_list ) # [10, 20, 30, 40]

26/28

27 of 37

2. Tuple​

3.5 Collection Data type

1

Tuples are List and Similar but Change Immutable data type

data Change I don't need it Not case Used​

2

my_tuple = (10, 20, 30) print( my_tuple [1]) # 20

27/28

28 of 37

3. Dictionary​

3.5 Collection Data type

1

A dictionary contains key-value pairs. Saving As a data type , �Key By using The value fast You can check it out

my_dict = {"name": "Alice", "age": 25} print( my_dict ["name"]) # Alice

28/28

29 of 37

4. Set​

3.5 Collection Data type

1

The set is duplication no The elements Saving As a data type , set Operation Support​

my_set = {1, 2, 3, 3, 4} print( my_set ) # {1, 2, 3, 4}

29/28

30 of 37

31 of 37

32 of 37

33 of 37

34 of 37

35 of 37

Practice Problems (1/2)

1

In ChatGPT Available for use For Python Plug-in Investigate and its functions simply Please explain .

MicroPython Use it IoT For devices The program What you can get when writing The advantage Please organize it .

Python after 2020 most important Programming In language It has risen sharply . Here is the reason why Please explain .

2

3

In Unicode Hangul Expressing In the method about Please explain .

4

35/28

36 of 37

Practice Problems (2/2)

5

In MicroPython Unicode In a way string But , the Internet In browser, in UTF-8 format string It shows two ways . Compare and Pros and cons Please explain .

  • Two sensors there is .
  • first​ of the sensor The name is 'dht11' and the values for ' temperature' and 'humidity' are 23 and 47 .
  • first​ of the sensor temperature expression The unit is Celsius (' celsius ') .
  • second​ of the sensor The name is 'bh1750' and the light It represents 450 as a value .
  • second​ of the sensor measurement The unit is It's ' lux ' .
  • Next same In the format Expresses . sensors = {'dht11': { omitted } , omitted }

next Information Refer to the dictionary data type Variable Express yourself .

6

36/28

37 of 37

Q&A

Copyright© 2025 Hanbit Academy, Inc.

All rights reserved.