קורס יסודות בינה מלאוכתית – RB23-08
האם בינה מלאכותית מסוגלת לחשוב ?
- תרגיל כיתה : אימון בינה מלאכותית שלב 1
1.1 קישור לתוכנה לסימון תוויות : https://www.makesense.ai/
2. תרגיל כיתה : אימון בינה מלאכותית שלב 1
2.1 קישור לתוכנה לסימון תוויות : https://www.makesense.ai/
תרגיל 3 לימוד והבנה – של קוד פיטון עבור הרצה של בינה מלאכותית .
משפטי תנאי :
- קלט Exercise 1: Is the number even
1 2 3 4 5 |
number = int(input("Enter a number: ")) if number % 2 == 0: print("The number is even") else: print("The number is odd") |
2. קלט Age Check
1 2 3 4 5 |
age = int(input("Enter your age: ")) if age >= 5: print("Welcome to the park!") else: print("You are too young to enter the park.") |
3. קלט Is the number positive or negative
1 2 3 4 5 6 7 |
number = int(input("Enter a number: ")) if number > 0: print("The number is positive") elif number < 0: print("The number is negative") else: print("The number is zero") |
4. קלט : Time Check
1 2 3 4 5 6 7 |
hour = int(input("Enter the hour (0-23): ")) if 6 <= hour < 12: print("Good morning!") elif 12 <= hour < 18: print("Good afternoon!") else: print("Good evening!") |
4. תרגול לולאות : בדיקת כלי טיס
1 2 3 4 5 6 |
vehicles = ["bird", "kite", "uav", "drone", "plane", "car"] for vehicle in vehicles: if vehicle in ["bird", "kite", "uav", "drone", "plane"]: print(f"{vehicle} is an aerial vehicle") else: print(f"{vehicle} is not an aerial vehicle") |
4.1. בדיקת פירות
1 2 3 4 5 6 |
items = ["apple", "banana", "carrot", "orange", "potato"] for item in items: if item in ["apple", "banana", "orange"]: print(f"{item} is a fruit") else: print(f"{item} is not a fruit") |
4.2. בדיקת ציפורים
1 2 3 4 |
items = ["bird", "kite", "uav", "drone", "plane"] for item in items: if item == "bird": print(f"{item} is a bird") |
4.3 בדיקת ציפורים בתוך רשימה מעורבת
1 2 3 4 5 6 7 8 |
results = ["bird", "kite", "uav", "drone", "plane", "moon", "car"] filtered_results = [] for result in results: if result == "uav": print("UAV found in sky") filtered_results.append(result) print("Filtered results:", filtered_results) |
4.4 בדיקת ציפורים בתוך רשימה מעורבת
1 2 3 4 5 6 7 |
results = ["bird", "kite", "uav", "drone", "plane", "moon", "car"] filtered_results = [] for result in results: if result != "bird" and result == "moon": filtered_results.append(result) print("Items that are not birds and are moons:", filtered_results) |
4.5 בדיקת ציפורים בתוך רשימה מעורבת
1 2 3 4 5 6 7 |
results = ["bird", "kite", "uav", "drone", "plane", "moon", "car"] filtered_results = [] for result in results: if result not in ["bird", "kite", "plane", "moon"]: filtered_results.append(result) print("Items different from bird, kite, plane, and moon:", filtered_results) |
5. תרגול ספירה
1 2 3 4 5 6 7 |
results = ["bird", "kite", "uav", "drone", "plane", "moon", "car", "uav"] count_uav = 0 for result in results: if result == "uav": count_uav += 1 print(f"Number of UAVs found: {count_uav}") |
5.1 הוספה למערך
1 2 3 4 5 6 7 8 9 10 |
results = ["bird", "kite", "uav", "drone", "plane", "moon", "car", "uav"] count_uav = 0 uav_list = [] for result in results: if result == "uav": count_uav += 1 uav_list.append(result) print(f"Number of UAVs found: {count_uav}") print("List of UAVs:", uav_list) |