#내장함수
'''
print()
input()
type()
int(), str(), float() 자료형 변환
sum() 숫자들의 합을 구하는 함수
max() 최대값 찾기
min() 최솟값 찾기
'''
list1 = [1, 2, 3, 4, 5]
print(sum(list1))
print(max(list1))
print(min(list1))
print(min('Aapple'))
print('----문제1----')
nuts = [3, 2, 5, 4, 6]
#도토리들의 총 무게는 얼마인가요?
#가장 가벼운 도토리는 몇 g인가요?
#가장 무거운 도토리는 몇 g인가요?
#메서드 : 특정 자료에 .을 찍어서 사용하는 방법
'''
문자열 메서드
lower() 전부 소문자
upper() 전부 대문자
find(a) a가 처음 나오는 인덱스를 찾아준다
replace(a, b) a를 b로 바꾼다
split(a) a를 기준으로 쪼개서 리스트에 저장한다
'''
t = 'Python is Fun'
print(t.lower())
print(t.upper())
print(t.find('in')) #찾는 문자열이 없는 경우 -1
print(t.replace(' ', '-'))
print(t.split()) #괄호 안에 안적으면 띄어쓰기를 기준으로 나눈다
print('----문제2----')
msg = "zpythqnZxisXcqqlz"
# 1. 모두 소문자로 바꾸기
msg = msg.lower()
print("1번:", msg)
# 2. z, x → 공백으로 바꾸기
msg = msg.replace('z', ' ')
msg = msg.replace('x', ' ')
print("2번:", msg)
# 3. q → o 으로 바꾸기
msg = msg.replace('q', 'o')
print("3번:", msg)
#mag에서 cool만 출력하기
msg = msg.split()
print(msg)
print(msg[2])
To embed this project on your website, copy the following code and paste it into your website's HTML: