This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # plotting_probabilities.py | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from scipy.stats import norm, binom, poisson | |
| def plot_normal_distribution(mu=0, sigma=1): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 12 A | |
| # importing libraries | |
| import pygame | |
| import time | |
| import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 11A | |
| import tkinter as tk | |
| # Function to change font style | |
| def change_font(): | |
| label.config(font=("Arial", 18, "bold")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 10A | |
| #pip install matplotlib | |
| import matplotlib.pyplot as plt | |
| languages = ['Java', 'Python', 'PHP', 'JavaScript', 'C#', 'C++'] | |
| popularity = [22.2, 17.6, 8.8, 8, 7.7, 6.7] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 9A | |
| # Initialize the list of grades | |
| grades = [85, 90, 78, 92, 88] | |
| # Display the grades list | |
| print("Grades List:", grades) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 8A | |
| def number_sequence(start, end, step=1): | |
| current = start | |
| while current <= end: | |
| yield current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 7A | |
| def analyze_student_grades(): | |
| # Sample data | |
| student_names = ["Alice", "Bob", "Charlie", "Diana"] | |
| student_grades = [85, 92, 78, 90] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 6A | |
| def copy_files(file_paths): | |
| for file_path in file_paths: | |
| if os.path.exists(file_path): | |
| with open(file_path, 'r') as original_file: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 5A | |
| def find_employee_by_id(employees, target_id): | |
| for employee in employees: | |
| if employee['id'] == target_id: | |
| return employee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TASK 4A | |
| #Add Elements: Add elements to the list. | |
| list=[10,20] | |
| a=30 | |
| list.append(a) |
NewerOlder