사용자의 입력을 애플리케이션으로 가져오기
Python
in_str = input("입력해주세요.\n")
print(in_str.upper()+" World!")
ideone.com
Ruby
puts("입력해주세요")
in_str = gets.chomp()
puts(in_str.upcase() + " World!")
ideone.com
로그인 애플리케이션에 입력 기능 추가하기
Python
in_str = input("아이디를 입력해주세요.\n")
real_egoing = "11"
real_k8805 = "ab"
if real_egoing == in_str:
print("Hello!, egoing")
elif real_k8805 == in_str:
print("Hello!, k8805")
else:
print("Who are you?")
ideone.com
Ruby
puts("아이디를 입력해주세요")
input = gets.chomp()
real_egoing = "11"
real_k8805 = "ab"
if real_egoing == input
puts("Hello!, egoing")
elsif real_k8805 == input
puts("Hello!, k8805")
else
puts("Who are you?")
end
ideone.com
참고
github