Final int
Enumerate index번호를 줄수있다
For i, com in enumerate(rate)
print(f"{변수}의 점수는 {변수}점이다")와같이 html의 백틱과 같은 기능을한다
Try안 내용을 시도하는데 오류시 멈추지말고
오류대신 except안에 내용을 실행이키고 계속 돌아라
Try:
Print
Except:
Print
From .py파일이름 import 함수이름
From age import agi
Map(함수이름, 리스트)
Lambda람다란?
함수까지 굳이 만들필요 있냐 그냥 한줄로 깔끔이 끝내자 map기능에 함수를 합친것과 같은 기능을 할수있다
Result = (lambda person : 조건문 , 리스트)
people = [{'name':'hel','age':32}]
Result = filter(lambda person : person['age']>20, people)
def hellow(one, two):
retunr one-two
hellow(two =7, one=11)
함수를 부를때 넣어주지 않는다면 기본값인 two=3이 들어가고 two=7을 넣어준다면 two자리에 7이 들어가게된다
def hellow(one, two=3):
retunr one-two
hellow(one=11)
def hellow(*args):
for name in args:
print(f'{name}님 어서오세여')
hellow('철수','매링','라면')
def hellow(*kwargs):
print(kwargs)
hellow(name='철수', age=30,height=190)
이렇게 보내면
딕셔너리 형태로 만들어준다