Em có tạo một đoạn code để tính can chi của từng năm:
can = ['Canh', 'Tân', 'Nhâm,', 'Quý', 'Giáp', 'Ất', 'Bính', 'Đinh','Mậu','Kỷ']
chi = ['Thân', 'Dậu', 'Tuất', 'Hợi','Tí','Sửu','Dần', 'Mão', 'Thìn', 'Tị', 'Ngọ', "Mùi"]
def year(prompt):
x = input(prompt)
if x % 10 == i and x % 12 == j:
return can[i], chi[j]
year(2000)
2000
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in year
TypeError: not all arguments converted during string formatting
Cho em hỏi là em sai ở đâu ạ?