python基础①

作者: 柳叶刀与小鼠标 | 来源:发表于2018-01-07 01:41 被阅读9次

改变工作环境

import os
os.chdir("I:\\pythonwork")
os.getcwd()
'I:\\pythonwork'

for循环

cities = ["beijing","shanghai","guangzhou"]
for city in cities:
    print(city)

if语句

animals = ["cat","mouse","rabbit"]

if "cat" in animals:
    print("yes")
else:
    print("no")

相关文章

网友评论

    本文标题:python基础①

    本文链接:https://www.haomeiwen.com/subject/voounxtx.html