Study/Python 5

[Python] [중급] 파이썬 예제 뽀개기 | 김왼손의 왼손코딩

#01 Say Hidef say_hi(name:str, age:int)    return "Hi. My name is {} and I'm {} years old.".format(name, age)print(say_hi('다희', 22)) #02 Correct Sentencedef c_s(text: str) -> str:    text = text[0].upper() + text[1:]    if not text.endswith('.'):        text += '.'    return text #03def first_word(text: str) -> str:    text = text.replace('.', ' ').replace(',', ' ').strip() //앞과 뒤의 공백 제거, 한 칸 이상..

Study/Python 2019.02.07

[Python] [초급]유기농냠냠파이썬 | 김왼손의 왼손코딩 1-71강

https://www.youtube.com/watch?v=ikCjr8-QYAs&list=PLGPF8gvWLYypeEoFNTfSHdFL5WRLAfmmm&index=10강의 주소  https://www.python.org/add python 3.6 to path 체크하고 다운받기 option - configure idle - setting ! 배경바꾸기 7print(1)print(-1)print(3.14)  8 연산자1print(1 + 2)print(3 - 4)print(2 * 3)print(16 / 2)  9 연산자2 ** 제곱// 몫% 나머지print(1 ** 2) // 1print(3 // 4) // 0print(5 % 6) // 5  11 복합할당연산자+=-=*=/=  12 변수이름a = 1A = 2..

Study/Python 2019.02.06

[Python] Repl.it - if/else/for문/print()

https://snakify.org/lessons/if_then_else_conditions/ - if/else x = int(input())if x > 0:    print(x)else:    print(-x)  - abs() : 절댓값 x = int(input())print(abs(x)) // 절댓값. input : 10 / output : 10input : -10 / output : 10 - bool print(bool(-10))    # Trueprint(bool(0))      # False - zero is the only false numberprint(bool(10))     # Trueprint(bool(''))     # False - empty string is the only fal..

Study/Python 2019.01.16

[Python] Repl.It - 입출력/나누기/올림/내림/math module

- string끼리 출력 : + # Read a string:a = input()# Print a string:print("Hello, " + a + "!") - string + int 출력 : , # Read an integer:a = int(input())# Print a value:print("The next number for the number ", a, " is ", (a + 1))print("The previous number for the number ", a, " is ", (a - 1)) - 정수 나누기 종류 print(63 / 5) : 소수점까지 나눈다print(63 // 5) : 정수까지만 나눈다print(63 % 5) : 나머지 계산 12.6123 - float# int는 무조건 ..

Study/Python 2019.01.16
출처: https://mingos-habitat.tistory.com/34 [밍고의서식지:티스토리]