Python

Python_study

minseok__ 2022. 10. 22. 00:26

지난 주 내용

# 1. 가로 20cm, 세로 10cm 삼각형 넓이
a= 20
b= 10
c= a*b/2
print(c,'cm')

100.0 cm

# 4번
 
문자열이나 자료 값의 길이를 나타내는 함수는 len()
 
 
# 5번
a = "Life is too short, You need Python"
a[-11:]

'need Python'

 

# 6번
a = "Python is the best choice"

text = a[:5]
print(text.upper())

b = "I only trust Python %d%%" %50
print(b)

PYTHO

I only trust Python 50%

 

 

이번 주차 문제