- idle >> python shell running
name = input('what is your name?')
what is your name? dk
print(name)
dk
idle >> new File >> source code edit >> save >> 'F5' to running
links = ['1','2','3']
for link in links:
...
string[start:end:step] >> step 미지정 시, 1 고정
string.find('str') >> 있으면 양수 리턴, 없으면 -1 리턴
in, not in >> value = 'str' in(not in) string >> return true/false
ex)
value = 'str' in 'string'
if value:
...
else:
...
import datetime
now = datetime.datetime.now()
print(now) # 2015-04-19 12:11:32.669083
nowDate = now.strftime('%Y-%m-%d')
print(nowDate) # 2015-04-19
nowTime = now.strftime('%H:%M:%S')
print(nowTime) # 12:11:32
nowDatetime = now.strftime('%Y-%m-%d %H:%M:%S')
print(nowDatetime) # 2015-04-19 12:11:32