2022. 08. 30.
리스트 데이터 타입
파이썬에서 실습한 내용.
students = ["egoing", "sori", "maru"]
grades = [2,1,4]
print("students[1]", students[1])
print("len(students)", len(students))
print("min(grades)", min(grades))
print("min(grades)", max(grades))
print("sum(grades)", sum(grades))
import statistics
print("statistics.mean(grades)", statistics.mean(grades))
import random
print("random.choice(students)", random.choice(students))
students[1] sori
len(students) 3
min(grades) 1
min(grades) 4
sum(grades) 7
statistics.mean(grades) 2.3333333333333335
random.choice(students) maru
정말 많은 데이터가 있다면 파이썬에서 순식간에 손쉽게 찾을 수 있다.
통계와 관련해서도 많은 기능들이 있다 최소값 최대값 평균 등..
statistics.
그리고 random. 기능도 신기하다. 데이터값들중 랜덤하게 결과를 뽑아내준다.
'Python_기초 (Python)' 카테고리의 다른 글
[파이썬] PyPi (0) | 2022.09.01 |
---|---|
[파이썬] 디버깅 (debugging) (0) | 2022.09.01 |
[파이썬] 변수 (Variable) (0) | 2022.09.01 |
[파이썬] 문자 데이터 타입 (String data type) (0) | 2022.09.01 |
[파이썬] 숫자형 데이터 타입 (Number data type) (0) | 2022.09.01 |
댓글