Print Py 1.1
Print Py 1.1
Print Py 1.1
Roll no : 23205
1. Python installation and configuration with windows.
To install Python on Windows and configure it properly, you can follow these steps:
1. Download Python Installer:
Go to the official Python website: python.org.
Navigate to the Downloads section.
Download the latest version of Python for Windows. Choose either the 64-bit
or 32-bit installer based on your system architecture.
2. Run the Installer:
Once the installer is downloaded, double-click on it to run.
Check the box that says "Add Python x.x to PATH". This will make Python
accessible from the command line.
Click "Install Now" to start the installation process.
3. Verify Installation:
After installation, open the Command Prompt (CMD).
Type python --version and press Enter. This should display the installed
Python version. If not, there might be an issue with the PATH configuration.
4. Set PATH Variable (if necessary):
If Python is not recognized in the command prompt, you might need to
manually add it to the PATH variable.
Go to Control Panel > System and Security > System > Advanced System
Settings > Environment Variables.
Under "System Variables", find the "Path" variable and select it, then click
"Edit".
Add the path to your Python installation directory (e.g., C:\Python39) to the
list of paths. Each path should be separated by a semicolon.
Click "OK" to save the changes.
5. Test Installation:
Close and reopen the Command Prompt.
Type python --version again. It should now display the installed Python
version without any issues.
1
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
2.Programs for understanding the data types, control flow statements, blocks
and loops
I. Data type List, Tuple, Set, Dictionary and operation on these data types.
# List operations
my_list = [8, 4, 2, 1, 6]
# Tuple operations
print("\nTuple operations")
my_tuple = (1, 2, 3, 4, 5)
# Set operations
print("\nSet operations")
my_set = {1, 2, 3, 4, 5}
# Dictionary operations
print("\nDictionary operations")
my_dict = {'a': 1, 'b': 2, 'c': 3}
2
# Adding or updating elements in the dictionary
my_dict['d'] = 4
my_dict.update({'e': 5, 'f': 6})
3
II. Program to find the area of a square
4
IV. Program to Check is a Number is Odd or Even.
5
VI. Python Program to Check is a Number is Prime or not Prime
def is_leap_year(year):
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
return True
else:
return False
year = int(input("Enter a year: "))
if is_leap_year(year):
print(year, "is a leap year")
else:
print(year, "is not a leap year")
6
VIII. Python Program to Check Armstrong Number
def is_armstrong(number):
num_str = str(number)
num_digits = len(num_str)
armstrong_sum = sum(int(digit) ** num_digits for digit in num_str)
return armstrong_sum == number
IX. Write a program to print the sum of natural numbers using recursion
def sum_of_natural_numbers(n):
if n <= 1:
return n
else:
return n + sum_of_natural_numbers(n - 1)
limit = int(input("Enter the upper limit: "))
if limit < 0:
print("Please enter a non-negative integer.")
else:
result = sum_of_natural_numbers(limit)
7
X. Write a program to accept decimal number and print its octal, binary and
hexadecimal.
def decimal_to_octal(decimal_number):
return oct(decimal_number)
def decimal_to_binary(decimal_number):
return bin(decimal_number)
def decimal_to_hexadecimal(decimal_number):
return hex(decimal_number)
8
XI. Write a program to check whether entered string & number is
palindrome or not.
def is_palindrome_string(s):
return s == s[::-1]
def is_palindrome_number(n):
return str(n) == str(n)[::-1]
9
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
3.Programs for understanding functions, use of built in functions, user
defined functions
print("Addition:", addition_result)
print("Subtraction:", subtraction_result)
print("Multiplication:", multiplication_result)
print("Division:", division_result)
10
II. Python Program to find the Factorial of a number. Using recursive function.
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
number = int(input("Enter a number: "))
if number < 0:
print("Factorial is not defined for negative numbers.")
else:
result = factorial(number)
print("The factorial of", number, "is:", result)
III. Python Program to display the multiplication Table. Make the Function for
it.
def multiplication_table(number, limit=10):
print(f"Multiplication Table for {number}:")
for i in range(1, limit + 1):
print(f"{number} x {i} = {number * i}")
11
IV. Python program to demonstrate decorators and generators
# Example usage
generate_fibonacci_sequence(10)
12
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
4.Programs to use existing modules, packages and creating modules,
Packages
I. Python program shows use of built in module and packages at least 30 built in
functions
13
print("11. System platform:", sys.platform)
print("12. Current date and time:", datetime.datetime.now())
print("13. JSON encoding of {'name': 'John'}:", json.dumps({'name': 'John'}))
print("14. Cartesian product of [(1, 2), ('a', 'b')]:", list(itertools.product([1, 2], ['a', 'b'])))
print("15. Match 'apple' in 'pineapple':", re.match('apple', 'pineapple'))
print("16. Retrieve URL:", urllib.request.urlopen("https://www.example.com"))
print("17. Current timestamp:", time.time())
print("18. Counter of characters in 'hello':", collections.Counter("hello"))
print("19. Strip punctuation from 'Hello, World!':", "Hello,
World!".translate(str.maketrans('', '', string.punctuation)))
print("20. Calendar of January 2024:", calendar.month(2024, 1))
print("21. Compress 'Hello, World!':", zlib.compress(b"Hello, World!"))
print("22. MD5 hash of 'Hello':", hashlib.md5(b"Hello").hexdigest())
print("23. Smallest 3 numbers in [5, 2, 8, 0, 1]:", heapq.nsmallest(3, [5, 2, 8, 0, 1]))
print("24. Greatest common divisor of 12 and 15:", fractions.gcd(12, 15))
print("25. Wrap text to 20 characters:", textwrap.wrap("Lorem ipsum dolor sit amet,
consectetur adipiscing elit.", 20))
print("26. Python version:", platform.python_version())
print("27. Shallow copy of [1, 2, 3]:", copy.copy([1, 2, 3]))
print("28. Reduce function to add [1, 2, 3, 4]:", functools.reduce(lambda x, y: x + y,
[1, 2, 3, 4]))
print("29. Base64 encoding of 'Hello':", base64.b64encode(b"Hello").decode('utf-8'))
print("32. Pickle serialize [1, 2, 3]:")
data = [1, 2, 3]
serialized = pickle.dumps(data)
print(serialized)
14
II. Python program to create module of Arithmetic operation
# arithmetic.py
# main.py
import arithmetic
# Perform arithmetic operations
result_add = arithmetic.add(5, 3)
result_subtract = arithmetic.subtract(10, 4)
result_multiply = arithmetic.multiply(6, 7)
result_divide = arithmetic.divide(20, 5)
# Display results
print("Addition:", result_add)
print("Subtraction:", result_subtract)
print("Multiplication:", result_multiply)
print("Division:", result_divide)
15
III. Python program to create package and use package.
# operations.py
# main.py
# Display results
print("Addition:", result_add)
print("Subtraction:", result_subtract)
print("Multiplication:", result_multiply)
print("Division:", result_divide)
16
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
5. Programs for implementations of all object-oriented concepts like class,
method, inheritance, polymorphism etc. (Real life examples must be covered for
the implementation of object oriented concepts)
I. Create class called, library with data attributes like Acc-number publisher,
title and author, the methods of the class should include a) Read ( ) - Acc-
number, title, author, publisher. b) Compute ( ) - to accept the number of day
late, calculate and display the fine charged at the rate of Rupees 5/- per day. c)
Display the data.
class Library:
def __init__(self, acc_number, publisher, title, author):
self.acc_number = acc_number
self.publisher = publisher
self.title = title
self.author = author
def read(self):
print("Acc-number:", self.acc_number)
print("Title:", self.title)
print("Author:", self.author)
print("Publisher:", self.publisher)
def compute(self, days_late):
fine = days_late * 5
print("Fine charged: Rs.", fine)
def display_data(self):
print("Acc-number:", self.acc_number)
print("Title:", self.title)
print("Author:", self.author)
print("Publisher:", self.publisher)
# Example usage:
book1 = Library(8421699, "Developer", "Java", "Author Shrey")
book1.read() # Display book information
book1.compute(3) # Calculate and display fine for 3 days late
book1.display_data() # Display book information again
17
II. Python program for Bank demo Deposit, withdraw functions and validation
like cannot withdraw amount greater than available balance if password is
wrong for more than 3 times block that account.
class BankAccount:
def __init__(self, account_number, balance, password):
self.account_number = account_number
self.balance = balance
self.password = password
self.attempts = 0
self.blocked = False
# Valid deposit
account1.deposit(1000)
# Valid withdraw
account1.withdraw(2000, "shrey7199")
18
19
III. Python program for Inheritance demo covering all type of inheritance
# Single Inheritance
class Parent1:
def show_parent(self):
print("Parent method")
class Child1(Parent1):
def show_child(self):
print("Child method")
# Multiple Inheritance
class A:
def method_a(self):
print("Method A")
class B:
def method_b(self):
print("Method B")
# Hierarchical Inheritance
class Base:
def method_base(self):
print("Base method")
class Derived1(Base):
def method_derived1(self):
print("Derived1 method")
class Derived2(Base):
def method_derived2(self):
print("Derived2 method")
# Multilevel Inheritance
class Grandparent:
def method_grandparent(self):
print("Grandparent method")
class Parent2(Grandparent):
def method_parent(self):
print("Parent method")
class Child2(Parent2):
def method_child(self):
print("Child method")
print("Single Inheritance:")
child_obj = Child1()
20
child_obj.show_parent() # Accessing parent method
child_obj.show_child() # Accessing child method
print("\nMultiple Inheritance:")
c_obj = C()
c_obj.method_a() # Accessing method from class A
c_obj.method_b() # Accessing method from class B
c_obj.method_c() # Accessing method from class C
print("\nHierarchical Inheritance:")
derived1_obj = Derived1()
derived1_obj.method_base() # Accessing method from base class
derived1_obj.method_derived1() # Accessing method from derived class
derived2_obj = Derived2()
derived2_obj.method_base() # Accessing method from base class
derived2_obj.method_derived2() # Accessing method from derived class
print("\nMultilevel Inheritance:")
child_obj = Child2()
child_obj.method_grandparent() # Accessing method from grandparent class
child_obj.method_parent() # Accessing method from parent class
child_obj.method_child() # Accessing method from child class
21
IV. Python program for Polymorphism Demo (Operator overloading, Method
overloading)
# Operator Overloading
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __str__(self):
return f"({self.x}, {self.y})"
# Method Overloading
class Calculator:
def add(self, a, b):
return a + b
# Example usage
print("Operator Overloading:")
point1 = Point(1, 2)
point2 = Point(3, 4)
print("Point 1:", point1)
print("Point 2:", point2)
print("Sum of Points:", point1 + point2)
print("\nMethod Overloading:")
calc = Calculator()
#print("Sum of 2 numbers:", calc.add(5, 6))
print("Sum of 3 numbers:", calc.add(5, 6, 7))
22
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
6. Programs for parsing of data, validations like Password, email, URL, etc.
Parsing Data:
JSON Parsing:
import json
# Parse JSON data
json_data = '{"name": "John", "age": 30}'
parsed_data = json.loads(json_data)
print(parsed_data)
XML Parsing:
import xml.etree.ElementTree as ET
# Parse XML data
xml_data = '<person><name>John</name><age>30</age></person>'
root = ET.fromstring(xml_data)
for child in root:
print(child.tag, child.text)
CSV Parsing:
import csv
# Parse CSV data
csv_data = "name,age\nJohn,30\nJane,25"
reader = csv.reader(csv_data.splitlines())
for row in reader:
print(row)
23
Email Validation:
import re
def validate_email(email):
pattern = r'^[\w\.-]+@[\w\.-]+\.\w+$'
return re.match(pattern, email) is not None
email = '[email protected]'
if validate_email(email):
print("Valid email")
else:
print("Invalid email")
URL Validation:
import re
def validate_url(url):
pattern = r'^https?://(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}(?:/[^/]*)*$'
return re.match(pattern, url) is not None
url = 'https://www.example.com'
if validate_url(url):
print("Valid URL")
else:
print("Invalid URL")
Password Validation:
import re
def validate_password(password):
# Add your password validation logic here
# Example: At least 8 characters, with at least one uppercase letter, one lowercase
letter, and one digit
return re.match(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$', password) is not
None
password = 'Password123'
if validate_password(password):
print("Valid password")
else:
print("Invalid password")
24
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
7. Programs for Pattern finding should be covered.
def print_star_pattern(rows):
for i in range(1, rows + 1):
print('* ' * i)
print_star_pattern(5)
def print_number_pattern(rows):
num = 1
for i in range(1, rows + 1):
for j in range(1, i + 1):
print(num, end=' ')
num += 1
print()
print_number_pattern(4)
def print_pyramid(rows):
for i in range(0, rows):
for j in range(0, rows - i - 1):
print(end=" ")
for j in range(0, i + 1):
print("*", end=" ")
print()
print_pyramid(5)
def print_diamond(rows):
for i in range(0, rows):
for j in range(0, rows - i - 1):
print(end=" ")
for j in range(0, i + 1):
print("*", end=" ")
print()
for i in range(rows - 2, -1, -1):
for j in range(0, rows - i - 1):
print(end=" ")
for j in range(0, i + 1):
print("*", end=" ")
print()
print_diamond(5)
25
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
8. Multithreading & Exception handling.
import threading
import time
# User-defined Exception
class CustomException(Exception):
def __init__(self, message):
super().__init__(message)
def run(self):
print("Starting " + self.name)
print_time(self.name, self.counter, 5)
print("Exiting " + self.name)
# Main function
if __name__ == "__main__":
26
# Exception handling
divide(10, 2) # No exception
divide(10, 0) # ZeroDivisionError
# User-defined exception
try:
raise CustomException("This is a custom exception.")
except CustomException as e:
print("Custom Exception caught:", e)
# Multithreading
# Create new threads
thread1 = MyThread(1, "Thread-1", 1)
thread2 = MyThread(2, "Thread-2", 2)
thread1.join()
thread2.join()
27
II. Python program to perform Exception handling (Divide by zero Exception)
# Main function
if __name__ == "__main__":
# Example division operations
divide(10, 2) # No exception
divide(10, 0) # ZeroDivisionError
III. Python program for Integer Input Validation with Exception Handling
(Example of ValueError Exception).
def get_integer_input(prompt):
while True:
try:
user_input = int(input(prompt))
return user_input
except ValueError:
print("Error: Please enter a valid integer.")
# Main function
if __name__ == "__main__":
try:
# Get an integer input from the user
number = get_integer_input("Enter an integer: ")
print("You entered:", number)
except KeyboardInterrupt:
print("\nUser interrupted the program.")
except Exception as e:
print("An error occurred:", e)
28
IV. Program for IndexError Exception in Python with Example.
def access_list_element(index):
my_list = [1, 2, 3, 4, 5]
try:
value = my_list[index]
print("Value at index", index, ":", value)
except IndexError:
print("Error: Index", index, "is out of range.")
# Main function
if __name__ == "__main__":
try:
# Access elements from the list
access_list_element(2) # Valid index
access_list_element(10) # Invalid index
except Exception as e:
print("An error occurred:", e)
29
V. Python Program for Raising User Generated Exception a) Write user
defined exception program in python which will except age as an input from
the user and check whether the user is eligible for voting or not. If age<18
it should raise the exception as ‘Not eligible for voting’
# Main program
def main():
try:
age = int(input("Enter your age: "))
check_voting_eligibility(age)
except ValueError:
print("Please enter a valid age (an integer).")
except UnderAgeException as e:
print(e)
if __name__ == "__main__":
main()
30
VI. Python Program for Multithreading-- Write multithread program, where
one thread prints square of a number and another thread prints cube of
numbers. Also display the total time taken for execution.
import threading
import time
def print_square(num):
print(f"Square of {num}: {num*num}")
def print_cube(num):
print(f"Cube of {num}: {num*num*num}")
if __name__ == "__main__":
num = int(input("Enter a number: "))
start_time = time.time()
square_thread.start()
cube_thread.start()
square_thread.join()
cube_thread.join()
end_time = time.time()
31
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
9.Programs demonstrating the IO operations like reading from file, writing
into file from different file types like data file, binary file, etc.
I. Python Program for writing log and change the log level.
import logging
# Set up logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger()
def change_log_level(level):
"""Function to change the log level dynamically."""
numeric_level = getattr(logging, level.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % level)
logger.setLevel(numeric_level)
print(f"Log level changed to {level.upper()}.")
def main():
logger.debug("This is a debug message.")
logger.info("This is an info message.")
logger.warning("This is a warning message.")
logger.error("This is an error message.")
logger.critical("This is a critical message.")
if __name__ == "__main__":
main()
32
II. Python Program for read functions and write functions such as read(),
readline() and readlines() and write() and writelines()
def read_file(filename):
"""Function to read from a file using different read functions."""
try:
with open(filename, 'r') as file:
# Read the entire file
print("Contents of the file (read()):")
print(file.read())
except FileNotFoundError:
print(f"Error: File '{filename}' not found.")
if __name__ == "__main__":
filename = "example.txt"
33
34
III. Write a program to read the contents of file and display occurrence of given
character.
def count_occurrences(filename, char):
try:
with open(filename, 'r') as file:
content = file.read()
occurrences = content.count(char)
print(f"The character '{char}' occurs {occurrences} time(s) in the file
'{filename}'.")
except FileNotFoundError:
print(f"Error: File '{filename}' not found.")
if __name__ == "__main__":
filename = "example.txt" # Replace with your file name
character_to_count = 'e' # Replace with the character you want to count
count_occurrences(filename, character_to_count)
35
IV. Python program on binary data file showing the file operations (read, search,
update, delete)
import os
def read_binary_file(filename):
"""Function to read a binary file."""
try:
with open(filename, 'rb') as file:
data = file.read()
return data
except FileNotFoundError:
print(f"Error: File '{filename}' not found.")
return None
def delete_binary_file(filename):
"""Function to delete a binary file."""
try:
os.remove(filename)
print(f"File '{filename}' deleted successfully.")
except FileNotFoundError:
print(f"Error: File '{filename}' not found.")
if __name__ == "__main__":
filename = "binary_data.bin" # Replace with your binary file name
36
if data:
print(f"Data read from '{filename}':")
print(data)
37
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
10.Programs to perform searching, adding, updating the content from the file.
import os
# Example usage:
file_path = 'example.txt'
# Searching
search_term = 'apple'
search_content(file_path, search_term)
# Adding
new_content = 'banana'
add_content(file_path, new_content)
# Updating
old_content = 'apple'
updated_content = 'orange'
update_content(file_path, old_content, updated_content)
38
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
11.Program for performing CRUD operation with MongoDB and Python.
import pymongo
student = {
"Student-ID": student_id,
"Name": name,
"Course": course,
"Mobile": mobile,
"Address": {
"area": area,
"city": city,
"country": country,
"pin": pin
}
}
39
# Function to delete documents based on a given condition
def delete_students(condition):
# Delete documents that match the condition
result = collection.delete_many(condition)
print(f"{result.deleted_count} document(s) deleted.")
# Main function
def main():
while True:
print("\n1. Insert Student")
print("2. Delete Student")
print("3. Exit")
choice = input("Enter your choice: ")
if choice == '1':
insert_student()
elif choice == '2':
# Specify the condition to delete documents (example: by name)
name = input("Enter the name of the student to delete: ")
condition = {"Name": name}
delete_students(condition)
elif choice == '3':
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
40
41
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
12. Basic programs with NumPy as Array, Searching and Sorting, date &
time and String handling
Using NumPy for Array Operations:
import numpy as np
# Sorting a list
def bubble_sort(arr):
n = len(arr)
for i in range(n):
for j in range(0, n-i-1):
if arr[j] > arr[j+1]:
arr[j], arr[j+1] = arr[j+1], arr[j]
# Example usage
my_list = [64, 34, 25, 12, 22, 11, 90]
target = 25
bubble_sort(my_list)
print("Sorted list:", my_list)
print("Index of", target, ":", linear_search(my_list, target))
42
Date & Time Handling:
import datetime
# Get current date and time
current_datetime = datetime.datetime.now()
print("Current date and time:", current_datetime)
String Handling:
# String manipulation
text = "Hello, world! This is a sample string."
# Splitting string
words = text.split()
print("Words in string:", words)
# Joining string
joined_text = "-".join(words)
print("Joined string:", joined_text)
# Reversing string
reversed_text = text[::-1]
print("Reversed string:", reversed_text)
43
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
13. Programs for series and data frames should be covered. i) Create series and
data frame manually. ii) Read CSV file perform statistical operation.
44
Read CSV File and Perform Statistical Operations:
import pandas as pd
# Statistical operations
mean_values = df.mean()
median_values = df.median()
max_values = df.max()
min_values = df.min()
print("\nMean values:")
print(mean_values)
print("\nMedian values:")
print(median_values)
print("\nMax values:")
print(max_values)
print("\nMin values:")
print(min_values)
45
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
14. Programs to demonstrate data pre-processing and data handling with data
frame (Missing value treatment, rank, sort, treatment for data duplication.)
import pandas as pd
# Sample DataFrame
data = {
'A': [1, 2, None, 4, 5],
'B': ['x', 'y', 'z', 'y', 'x'],
'C': [7, 2, 5, None, 3]
}
df = pd.DataFrame(data)
# Handling missing values
df.fillna(df.mean(), inplace=True) # Filling missing values with column mean
print("After handling missing values:")
print(df)
# Ranking
df['Rank_A'] = df['A'].rank()
print("\nAfter ranking column 'A':")
print(df)
# Sorting
df_sorted = df.sort_values(by='B') # Sorting by column 'B'
print("\nAfter sorting by column 'B':")
print(df_sorted)
# Handling duplicates
df_duplicates = df.drop_duplicates() # Dropping duplicate rows
print("\nAfter handling duplicates:")
print(df_duplicates)
46
Name : Bhagwat Shreyas Ravindra
Roll no : 23205
15. Program for data visualization should be covered. i) Python program for
simple graph(line) generation ii). Python program for Multiline graph iii) Python
program for creating scatter, bar, histogram, pie chart.
plt.plot(x, y)
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Simple Line Graph')
plt.show()
47
# ii. Multiline graph
def multiline_graph():
x = [1, 2, 3, 4, 5]
y1 = [2, 3, 5, 7, 11]
y2 = [1, 4, 9, 16, 25]
48
# iii. Scatter plot
def scatter_plot():
x = [1, 2, 3, 4, 5]
y = [2, 3, 5, 7, 11]
plt.scatter(x, y)
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Scatter Plot')
plt.show()
scatter_plot()
49
# Bar chart
def bar_chart():
x = ['A', 'B', 'C', 'D', 'E']
y = [10, 20, 15, 25, 30]
plt.bar(x, y)
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Bar Chart')
plt.show()
bar_chart()
50
# Histogram
import matplotlib.pyplot as plt
def histogram():
data = [1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5]
plt.hist(data, bins=5)
plt.xlabel('Values')
plt.ylabel('Frequency')
plt.title('Histogram')
plt.show()
histogram()
51
# Pie chart
import matplotlib.pyplot as plt
def pie_chart():
labels = ['A', 'B', 'C', 'D']
sizes = [15, 30, 45, 10]
pie_chart()
52
53