목 차
1. Primitive data type(원시 자료형)에 대해 알아보기.
2. Type error(자료형 타입 에러) 처리해보기
3. Mathmatical opertaion(수학 연산자)에 대해서 알아보기
4. f-string에 대해 알아보기
5. Conditional Expression(조건절)에 대해 알아보기
6. Multiple if Conditional Expression(복합 조건절)에 대해 알아보기
7. Logicla Operator(논리 연산자)에 대해서 알아보기
8. Randomization(임의) 모듈에 대해서 알아보기
9. 동전 앞뒤 맞추기
10. 실리콘 밸리 기업문화.
# 04. Primitive data type(원시 자료형)에 대해 알아보기.
# Integers(정수형)
progile_number = 7216
print(progile_number)
# Floats(실수형으로 변환)
score = float(60)
print(score)
# Booleans(불리언형, 참/거짓)
is_student = True
print(is_student)
# Strings(문자열형)
dba_name = "data_forge" #따옴표 2개로 표시.
db_name = 'andamiro' #따옴표 1개로 표시.
schema_detatil ="""this shcema is about
data_forge""" #여러줄 문자열은 큰따옴표 3개로 표시.
print(dba_name)
print(db_name)
print(schema_detatil)
# string indexing(문자열 인덱싱)
name = "data_forge"
print(name[0])
print(name[1])
print(name[2])
print(name[3])
print(name[4])
print(name[5])
print(name[6])
print(name[7])
print(name[8])
print(name[9])
# check object type (객체 타입 확인)
print(type(name))
# 05. Type error(타입 오류)에 대해 알아보기.
# str + int = error
print("Hello" + 1 + "World")
# convert type (타입 변환) int to str
print(type(1))
print(type(str(1)))
print("Hello" + str(1) + "World")
# 06.Mathmatical opertaion(수학 연산자)에 대해서 알아보기
print(1 + 2)
print(1 - 2)
print(1 * 2)
# /의 리턴값은 float = /(나누기 연산자)
print(1 / 2)
print(1/1)
# floor division(몫) = //(몫 연산자)
print(3//2)
print(7//3)
# Exponentiation(제곱) = **(제곱 연산자)
print(2**3)
print(3**3)
# modulo(나머지) = %(나머지 연산자)
print(60 % 13)
print(52 % 8)
# PEMDAS(수학 연산자 우선순위)
Parentheses(괄호)
Exponents(제곱)
Multiplication(곱셈)
Division(나눗셈)
Addition(덧셈)
Subtraction(뺄셈)
And Left To Right(왼쪽에서 오른쪽으로 계산)
sum = 8
sum += 1 #sum = sum + 1
print(sum)
공부하면서 듣고 있는 인프런의 '실리콘밸리 엔지니어가 가르치는 파이썬 기초부터 고급까지' 강의 링크입니다.
이 링크를 통해 구매하시면 제가 수익을 받을 수 있답니다. 🤗