티스토리 뷰
Three ways to create strings
'Alpha'
"Bravo"
str(3)
String methods
len("Charlie")
"Delta".upper()
"Echo".lower()
Printing a string
print "Foxtrot"
Advanced printing techniques
g = "Golf"
h = "Hotel"
print "%s, %s" % (g, h)
Date and time
from datetime import datetime now = datetime.now() print '%s/%s/%s %s:%s:%s' % (now.month, now.day, now.year, now.hour, now.minute, now.second)
'IT > Python: Codecademy' 카테고리의 다른 글
6 Student Becomes the Teacher (0) | 2018.02.24 |
---|---|
5 Lists & Dictionaries (0) | 2018.02.22 |
Python 4 Functions (0) | 2018.02.21 |
Python 3 Conditionals and Control Flow (0) | 2018.02.21 |
Python: 1 Python Syntax (0) | 2018.02.18 |
댓글