쓸만한 메소드 정리

이동규 (Justin)·2020년 6월 11일
0

먼저 w3schools 를 참고해서 쓸만해보이는 메소드들을 골라내본다. 기본적인 것 부터 눈과 손에 익히기 위해..

for loop

# for 이후 else 를 쓰게 되면 looping이 끝마쳐진 이후의 시행을 정의할 수 있다.

for x in range(6):
 	print(x)
else:
	print('for loop is finished')
    
    
# 기본적인 nested loop
nums = [1,2,3]
strings = ['a','b','c']

for num in nums:
	for str in strings:
    	print(num,str)

while

i=1
while i<=6:
	print(i)
	i+=1

function

def printName(name):
	print('Hello, '+name);
    
printName('dg');

확실히 파이썬이 재밌다. 벨로그에 글쓰는 것도..재밌다.

깔끔하고 빠르고 편하다.

profile
Frontend Developer, JamStack, Ethereum

0개의 댓글