Say "Hello, World!" With Python
>>> print("Hello, World!")
Hello, World!
해설
print함수를 이용하여 Hello, World!를 출력한다
# print(value(s), sep= ‘ ‘, end = ‘\n’)
>>> print("삼성")
>>> print("전자")
삼성
전자
>>> print("삼성", "전자")
>>> print("삼성", "전자", sep='_')
삼성 전자
삼성_전자
>>> print("삼성", end='_')
>>> print("전자")
삼성_전자
print함수는 메시지를 출력한다.
문법
print(value(s), sep= ‘ ‘, end = ‘\n’)
파라미터
· value(s) : 출력할 값
· sep= ’구분자’ : (Optional) 출력할 값들 사이에 들어가는 구분자 (기본값: 공백)
· end=’end’: (Optional) 문자열을 출력후 그 다음에 출력할 문자 (기본값: 줄바꿈)
'Develop > hackerrank.com' 카테고리의 다른 글
HackerRank Python Solution / Write a function (0) | 2021.12.31 |
---|---|
HackerRank Python Solution / Loops (0) | 2021.12.30 |
HackerRank Python Solution / Division (0) | 2021.11.12 |
HackerRank Python Solution / Arithmetic Operators (0) | 2021.11.12 |
HackerRank Python Solution / If-Else (0) | 2021.11.11 |