【发布时间】:2018-03-13 23:10:14
【问题描述】:
在一个项目中,我们获得了三个 csv 文件(按城市名称)。项目需要编写一个交互式代码,如果用户指定一个城市,则会显示该城市的完整路径名。
def get_city():
'''Asks the user for a city and returns the filename for that city's bike share data.
Args:
none.
Returns:
(str) Filename for a city's bikeshare data.
'''
city = input('\nHello! Let\'s explore some US bikeshare data!\n'
'Would you like to see data for Chicago, New York, or Washington?\n')
【问题讨论】:
-
你有什么问题?
-
欢迎来到 SO。不幸的是,这不是一个讨论论坛或教程。请花时间阅读How to Ask 和该页面上的其他链接。花一些时间与the Tutorial 一起练习示例。它会让你了解 Python 提供的工具来帮助你解决问题。