티스토리 뷰

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
댓글
Announcement
Recent Posts
Recent Comments
Total
Today
Yesterday
Link
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Search by month