亞東科技大學 電機系 施勢帆老師的教學網站

 找回密碼
 立即註冊
搜索
熱搜: 活動 交友 discuz
查看: 36|回復: 0

10/29 - 4

[複製鏈接]

66

主題

66

帖子

314

積分

管理員

Rank: 9Rank: 9Rank: 9

積分
314
發表於 7 天前 | 顯示全部樓層 |閱讀模式

# Travel Weather Planner
# 旅遊天氣與通勤規劃器

# 設定基本變數
distance_mi = 5
is_raining = False
has_bike = True
has_car = False
has_ride_share_app = False

# 判斷是否可以通勤
if not distance_mi:
    print(False)

elif distance_mi <= 1:
    if not is_raining:
        print(True)
    else:
        print(False)

elif distance_mi <= 6:
    if has_bike and not is_raining:
        print(True)
    else:
        print(False)

else:
    if has_car or has_ride_share_app:
        print(True)
    else:
        print(False)


回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|手機版|小黑屋|亞東科技大學 電機系 施勢帆老師的教學網站

GMT+8, 2026-11-5 00:41 , Processed in 0.048693 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表