인프라 & 클라우드 & 코딩 이야기/자세한 백준 문제 풀이

백준 단계별로 풀어보기 - Hello World(2557번) with Python

인생여러방 2023. 3. 5. 12:09
728x90
반응형

문제(https://www.acmicpc.net/problem/2557)
Hello World!를 출력하시오.

예제 입력 : 없음
예체 출력 : Hello World!

문제 포인트 : print() 활용

728x90
반응형

코드 1:
print("Hello World!")

코드 2:
words = "Hello World!"
print(words)

코드 3:
words_1 = "Hello"
words_2 = "World!"
print("{0} {1}".format(words_1, words_2))

코드 4
words_1 = "Hello"
words_2 = "World!"
print(f"{words_1} {words_2}")

 

출력 결과

 

*관련 문법 정리
https://multitasker-sh.tistory.com/1

 

[Python] print( ) & 문자열 (str) 1번째 (2557번, 10718번)

print( ) 1) 숫자 출력 ex) print(45) >>>45 1-1) 연산한 결과 출력 ex) print(4+5) >>>9 2) 문자(열) 출력 ex) print("Python Coding") >>>Python Coding print("1+5") >>>1+5 3) 변수 출력 ex) words = "Hello" print(words) >>>Hello 4) 변수 + 문

multitasker-sh.tistory.com

 

728x90
반응형