Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
311 B
3
Indexable
Never
from docx.api import Document

nam_sinh=input("nhap nam sinh cua ban")

ket_qua="bạn nam nay " + str(2022-int(nam_sinh)) + " tuoi"

# wconvert=open("wordtest.docx",mode="w",encoding="utf-8-sig")
wconvert=Document()
wconvert.add_paragraph(str(ket_qua))

wconvert.save('wordtest.docx')
print(ket_qua)