|
关联资源下载链接:
管理员身份运行 Windows PowerShell,输入
python
获得回复当前Python版本信息等。
PyCharm 安装并激活,新建工程,新建 .py 文件,测试代码
print("Hellow world!")
通过 input 等函数实现人机交互
# input apple price
price_str = input("The price of each unit apple is ")
# weight of apple
weight_str = input("Give the weight of apple please ")
# calculate total price
# transform to float
price = float(price_str)
# transform weight to float
weight = float(weight_str)
# calculate price
money = price * weight
print(money)