본문 바로가기
Python

Python PYPI, 파이썬 비교연산자, 기본 조건문

by Jann 2022. 1. 9.
728x90

모든 프로그래밍 언어는 입력 - 과정 - 출력 위주로 익히는 것이 좋다.

Python's input - Process - output : keyboard - Process  - monitor

 

name = input('name :')
message ='hi, '+name+' ....bye, '+name+'.'
print(message)

 

Python PYPI(Python Package Index) : 

Repository of software fot the Python programming language

:: 파이썬으로 만들어진 패키지를 저장하고 검색할 수 있는 데이터베이스의 개념

내가 만든 패키지를 pypi에 업로드하면 다른 사람들이 pip 명령어를 통해 해당 패키지를 설치할 수 있기도 하다.

 

 예) Pandas >> pip install pandas 명령어로 설치할 수 있다.

python3 -m install pandas > 명령어가 더욱 추천되는 설치 방법

 

Python Comparision Operator 파이썬 비교연산자

 

비교 연산을 위한 데이터 타입 Boolean = 참 True + 거짓 False 

KeyPoint : True / False 를 언제 사용할 것이

print('1 == 1', 1 == 1)
print('1 == 2', 2 == 1)
print('1 < 2', 1 < 2)
print('1 > 2', 1 > 2)
print('1 >= 1', 1 >= 1)
print('2 >= 1', 2 >= 1)
print('1 != 1', 1 != 1)
print('2 != 1', 2 !=1 )

 

Flow Control 제어문 = 조건문(Conditinal) + 반복문(Loop)

 

Conditinoal Statement 

- if boolean : code 

- if boolean : code 

       else : code

# 012
print(0)
if True:
  print(1)
print(2)

# 02
print('-----')
print(0)
if False:
    print(1)
print(2)

 

기본 조건문 사용하기 : if boolean : code 

input_id = input('id :')
id = 'name'
if input_id == id:
  print('Welcome')

728x90

댓글