커뮤니티

고용노동부, 산업인력공단과 함께하는 강원도 유일한 기업중심 IT전문교육기관 ICT융합캠퍼스만의 특별한교육입니다.
공인 IT숙련기술인의 다양한 접근방법으로 전문가다운 실무교육을 받을 수 있습니다.

Category

교육강좌

언어 Python & Ruby - 입력과 출력

페이지 정보

작성자 관리자 댓글 0건 조회 2,410회 작성일 20-06-10 13:54

본문

입력과 출력

사용자의 입력을 애플리케이션으로 가져오기

Python

1
2
in_str = input("입력해주세요.\n")
print(in_str.upper()+" World!")

ideone.com

Ruby

1
2
3
puts("입력해주세요")
in_str = gets.chomp()
puts(in_str.upcase() + " World!")

 ideone.com

 

로그인 애플리케이션에 입력 기능 추가하기

Python

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
7
8
9
10
11
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

  • 트위터로 보내기
  • 페이스북으로 보내기
  • 구글플러스로 보내기

답변목록

등록된 답변이 없습니다.