📌  相关文章
📜  TypeError: 'int' object is not subscriptable 解决方案 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:20.184000             🧑  作者: Mango

代码示例1
birth_date = input("Please enter your birthdate in the format of (mmddyyyy) ")

birth_month = birth_date[0:2]
birth_day = birth_date[2:4]
birth_year = birth_date[4:8]

print("Birth Month:", birth_month)
print("Birth Day:", birth_day)
print("Birth Year:", birth_year)