Print:
import datetime import random print("hello Python") print("hello ", end="") print("Python") name = "Aimery" num = 0 print(f"Hello {name}'s Python sharing number {num}") s1 = "Hello {1}'s Python sharing number {0}".format(num, name) print(s1) decimal = 16 print(hex(decimal)) print(str(decimal).zfill(5)) print("%.2f" % decimal) print("<", "text".ljust(20, '+'), ">") print("<", "text".center(20, '*'), ">") print("<", "text".rjust(20, '-'), ">") s1 = " hi\n\t" print(s1, end="") print("python") s1 = s1.strip() print(s1, end="") print("python")
now_time = datetime.datetime.now() print(now_time) print(datetime.datetime.strftime(now_time, '%Y:%m:%d-%H:%M:%S.%f'))