본문 바로가기

전체 글170

[Python]3.6.1 설치 Python(3.6.1) 설치 1. Python Download Web Site https://www.python.org 2. Download File Install Install시 'Add Python 3.6 to PATH' Check 3. 설치 확인 - MAC 터미널 실행 후 DevInside-MacBookui-MacBook-Pro:~ DevInside$python↵ - Windows Cmd 창 실행 후 C:\사용자경로>python↵ * macOS에서 python으로 python3 실행하기 : python3을 모두 입력하기 귀찮으면 다음과 같이 python만 입력해도 되도록 설정을 변경 할 수 있다. ① 터미널에서 open -a TextEdit ~/.bash_profile을 입력 ② 편집기가 뜨면 맨.. 2017. 6. 3.
[Python]if-else if-else 코드SCISSOR = '가위'ROCK = '바위'PATER = '보' WIN = '승리'DRAW = '비김'LOSE='패배' i = '가위'y='바위' if i == y: result = DRAWelse: result = '승리 또는 패배' print(result) 결과승리 또는 패배 if-elif-else 코드w = '비' if w == '비': result = '파전'elif w == '맑음': result = '떡볶이'else: result = '피자' print(result) 결과파전 2017. 6. 2.
[Python]if문 ifpeople = 3apple = 20 if people 0: print('몇개는 나눠 먹어야 해요')맛있게 먹을 수 있겠군요. 몇개는 나눠 먹어야 해요 2017. 6. 2.
[Python]사칙연산 코드a=33b=3 plus=a+bminus=a-bmultiply=a*bdivide=a/bremainder=a%bpower=a**b print('더하기 :' + plus) print('빼기 :' + minus)print('곱하기 :' + multiply)print('나누기 :' + divide)print('나머지 :' + remainder)print('제곱 :' + power) 결과 더하기 : 36 빼기 : 30 곱하기 : 99 나누기 : 11.0 나머지 : 0 제곱 : 35937 2017. 6. 2.