發表文章

HW03 判斷敘述式

圖片
 1. NotebookLM 2. 學習卡 3. 影片  4. 寫1個程式需附加說明 Create a README For Github Weather-Based Activity Recommendation 📌 Introduction This is a simple Python program that recommends an activity based on the weather temperature and humidity. The program uses if , else , and logical operators ( and ) to determine which activity is suitable for the given weather conditions. 🎯 Program Objective The program asks the user to enter: Temperature: Warm or Cold Humidity: Humid or Dry Based on the user's input, it recommends one of four activities. 💻 Source Code temp = input('Enter the temperature: (warm/cold): ') hum = input('Enter humidity: (humid/dry): ') if temp == 'warm' and hum == 'dry': print('Play Basketball') else: if temp == 'warm' and hum == 'humid': print('Play Tennis') else: if temp == 'cold' and hum == 'dry': print('Play Cricket') else: ...

HW02 運算子表達式

圖片
    HW02 運算子表達式 1. NotebookLM 2.  影片 3. 測驗和 學習卡 4.  Kilogram to Pound and Tonne Converter 🐍 📌 Description This Python program reads the weight of an object in kilograms and converts it into pounds and tonnes. It uses simple arithmetic operations to calculate the converted weights. 🎯 Objective To write a Python program that accepts weight in kilograms and displays the equivalent weight in pounds and tonnes. 📐 Conversion Formula 1 Kilogram = 2.20 Pounds 1 Kilogram = 0.001 Tonne 💻 Python Code weight = int(input('Enter the weight of object in kilogram:')) pounds = weight * 2.20 Tonne = weight * 0.001 print(' Weight = ', weight, ' Kilograms') print(weight, ' kg = %.2f' % (pounds), ' pounds') print(weight, ' kg = %.2f' % (Tonne), ' Tonne') ▶️ Sample Output Enter the weight of object in kilogram: 100 Weight = 100 Kilograms 100 kg = 220.00 pounds 100 kg = 0.10 Tonne 🧠 How It Works The program asks the user to enter the weight in...
圖片
 回家作業 第一次 1. notebook   2. 學習卡 3. 測驗 4. 影片