Python

[Python] 표준 입력 (User Input)

MeDiscovery 2019. 12. 12. 12:35

[Python] 표준 입력 (User Input) Start

BioinformaticsAndMe







파이썬 표준 입력 (Python Input function)


: 파이썬은 사용자에게 임의의 정보를 입력하도록 요청할 수 있는 Input function이 존재

: 표준 입력 방법은 'Python3' 및 'Python2'에서 서로 다름




1. 파이썬 3 표준 입력


: 파이썬 3는 Input() 메소드 사용

# 유저 이름 입력받기

username = input("Enter username:") print("Username is: " + username)

Enter username: Gold Username is: Gold




2. 파이썬 2 표준 입력


: 파이썬 2는 raw_Input() 메소드 사용

# 유저 이름 입력받기

username = raw_input("Enter username:") print("Username is: " + username)

Enter username: Silver Username is: Silver





#Reference

1) https://www.w3schools.com/python/python_user_input.asp

2) https://pynative.com/python-input-function-get-user-input/





[Python] 표준 입력 (User Input) End

BioinformaticsAndMe