파이선 string 출력1 파이썬 string 포멧 출력하기 파이썬에서 {}와 .format을 사용하여 string포맷으로 만들 수 있습니다. 간단한 예 name="James" print("The name is {}".format(name)) 여러 개의 string 포맷을 사용할 수 있습니다. 다음은 name과 lastname을 string 포맷을 사용하여 출력하였습니다. name="James" lastname="Smith" print("His first name is {}and last name is {}".format(name,lastname)) 숫자도 사용할 수 있습니다. age=20 print("His first name is {}and last name is {}. He is {} years old".format(name,lastname, age)) li.. 2021. 5. 24. 이전 1 다음