Download presentation
Presentation is loading. Please wait.
Published byLasse Järvinen Modified over 5 years ago
1
Python Open source Many applications Python 3 jupyter notebook
Indentation : no begin end
2
Variable Case sensitive
3
Type conversion
4
Python data types float : real numbers int : integer numbers
str : string, text bool : True.False Python List : [a, b, c] Collection of variables Contain any type Contain different types
5
Subset of lists Zero based indexing : [1, “ab”, 3.4] 1은 0번째 “ab"는 1번째
6
List slicing : 를 이용함2 list[index1: index2 ] list[:index] list[index:]
: 를 이용함2 list[index1: index2 ] index1 부터 index2-1 까지 test[2:4] : text list의 2번째 부터 (4-1) 번째 list[:index] list[index:] -3 -2 -1 1 2 3 4 5
7
List indexing List of lists
8
Mutable List Mutable : 내용을 변화할 수 있음 Change list elements
Add list elements Remove list elements
9
Adding and removing
10
Replace list elements
11
Copying lists Use = sign to copy lists
12
Copying lists x y Use list to copy
13
Looping through a list indentation for item-variable in list : # code
14
While loop while condition : # code
15
Sorting a list and append an element
sorted() sort()
16
ranges range(index) : 0 – (index-1)
17
Dictionary Key와 value로 표현되는 데이터 구조 Mutable Create an empty dictionary
Create a dictionary
18
Delete a dictionary elements
List와 마찬가지로 del del(list[index]) del(dictionary[key])
19
Unique keys
20
Returning a value and get() function
21
Print dictionary elements
22
Print dictionary items
dictionary.items() 은 key value pair return
23
Dictionary contains a dictionary
24
Print dictionary items
25
Remove items
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.