프로그래밍/BOJ_Python 목표는 Diamond
파이썬 사용자 입출력: input(), print()
서이서
2022. 4. 10. 23:14
아래의 print문은 동일한 결과값을 출력한다.
print("Life" "is" "too short")
>>Lifeistoo short
print("Life"+"is"+"too short")
>>Lifeistoo short
띄어쓰기는 콤마로 한다.
print("Life","is","too short")
>>Life is too short
print문으로 출력시 결과값을 한 줄로 출력하고 싶을 때는 매개변수 end를 사용하자.
for i in range(10):
print(i, end=' ')
>> 0 1 2 3 4 5 6 7 8 9