분류 전체보기 330

update, islower, if in, abs, reverse, pprint, add, discard, union, intersection, symmetric_difference, issubset, issuperset, isdisjoint, enumerate

update It takes a key-value pair and puts into the existing dictionary. icecream = {'탱크보이': 1200, '폴라포': 1200, '빵빠레': 1800, '월드콘': 1500, '메로나': 1000} new_product = {'팥빙수':2700, '아맛나':1000} icecream.update(new_product) icecream >>> {'탱크보이': 1200, '폴라포': 1200, '빵빠레': 1800, '월드콘': 1500, '메로나': 1000, '팥빙수': 2700, '아맛나': 1000} islower Checks if all the characters in the text are in lower case. user_i..

Basic Python 2021.05.18

sep, end=, replace, upper, lower, isupper, islower, capitalize, insert, join, *(star expression), partition

sep Seperator, between the arguments to print() function. print('naver','kakao','samsung',sep=';') >>> naver;kakao;samsung print('naver','kakao','sk','samsung',sep='/') >>> naver/kakao/sk/samsung end= It can be put anything in end, then it will be following. '\n\ is the default. print("first",end=' ');print("second") >>> first second ; : Multiple command in one line. replace string.replace(old,n..

Basic Python 2021.05.08

open, readlines, collections, split, read, seek, writer, writerow, close, mode='at'

Open the file. 1. Open the exist file. open('file path', 'open mode') It returns the objects which has file content. The available modes are f=open('/Users/joohyunyoon/Downloads/Book2.xlsx', 'r') f >> ['\ufeffNAVER\n', 'Hyundai\n', 'LG\n', 'Kia'] A newline character (\n) is left at the end of the string, and it needed to be ommitted(using strip()). for line in lines: line = line.strip() collecti..

Basic Python 2021.05.06