python基础①

改变工作环境

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")

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券