카테고리 없음
Python (실습)
nick-p
2024. 11. 20. 12:33
- 출력(print)
- print에 모든 인자들을 넣으면 출력해준다
print("Hello World!!") print({'name': 'John', 'age': 25}) print([1,2,3,]) # sep 에 값으로 문자열 사이를 채움 print('home', 'user', 'documents', sep='#')
- Input 명령어에 대해 알아보기
# What is your age?17 # 17 # print(input("What is your age?")) # How are you? what is your name?nick # My name is nick # print("My name is "+input("How are you? what is your name?")) # what is your name?nick # 4 # print(len(input("what is your name?")))
- Variable (변수) 에 대해 알아보기
# what is your name? nick # Here is my name, nick #name = input("what is your name? ") #print("Here is my name, "+name) # x,y=1,2 # print(x) # print(y) # x=y=1 # print(x) # print(y) # print(x+y) # int + float => float # print(1 + 1.5) # str + str => str print("Hello" + "world")
- Primitive data type(원시 자료형) 에 대해 알아보기
# profile_number = 2030 # print(profile_number) # Boolean (True or False) # is_correct = True # String(str) teacher_name = "Cisaca" print(teacher_name) # String subscript # print(teacher_name[len(teacher_name)-1]) print(type(teacher_name))
- Type error 처리
# str + int # print("Hello"+1) # Convert print(type(1)) print(type(str(1))) print("Hello"+str(1))
인프런 주소 : https://inf.run/wWrH
실리콘밸리 엔지니어가 가르치는 파이썬 기초부터 고급까지 강의 | 미쿡엔지니어 - 인프런
미쿡엔지니어 | 실리콘밸리 소프트웨어 엔지니어에게 배우는 파이썬의 모든 것. 현재 14년차 소프트웨어 개발자로 웹 어플리케이션, 빅데이타 그리고 SRE & 데브옵스까지 파이썬으로 다 처리하고
www.inflearn.com