要接收用户输入并将其存储到变量year_str中,你可以使用以下Python代码: ```python year_str = input("请输入年份:") ``` 这样,程序会等待用户输入年份,并将输入的值存储在变量year_str中。