Programming/python37 [python] 클래스 연습 python 1. class class Person: def greeting(self): print("hello") 클래스 사용 시, james= Person() class Person: def greeting(self): print("hello") # 클래스 사용 시, james = Person() # 매서드 호출 시, 인스턴스를 통해 호출 함 james.greeting() 2023. 3. 11. [python] 리스트 연습 파이썬 1. 리스트의 중요 기능 1) append: value 하나 추가 => append는 항상 리스트의 길이가 1씩 증가합니다. 2) extend: 리스트 연결해서 확장 3) insert: 특정 인덱스에 요소 추가 2023. 3. 8. [python] Day 28 # for i in x: # print(i*10, end="") number = int(input()) a = range(1, 10) for i in a: print(f"{number}*{a}={number*a}") # import random # random.randint(a,b) #a,b 모두 포함 # while 1: # 0이 아닌 숫자는 True로 취급하여 무한 루프로 동작 # print('Hello, world!') # while 'Hello': # 내용이 있는 문자열은 True로 취급하여 무한 루프로 동작 # print('Hello, world!') balance = int(input()) while balance > 0: balance -= 1350 print(balance) start, st.. 2023. 3. 7. [python] Day 26 코딩도장 - 파이썬 # 3.7 print("Hello, world!") print("Hello, world!") # 실수 계산 하기 print(float(1.1+2)) print(type(3.5)) # QUIZ # 5.5 # print(102 * 0.6 + 225) 2023. 3. 5. 이전 1 ··· 5 6 7 8 9 10 다음