0% found this document useful (0 votes)
34 views42 pages

Ai Project File (Tarun)

Class 10

Uploaded by

tarunbhadoriyaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
34 views42 pages

Ai Project File (Tarun)

Class 10

Uploaded by

tarunbhadoriyaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 42
NO.1 AIR FORCE SCHOOL, GWALIOR ARTIFICIAL INTELLIGENCE PYTHON PROJECT FILE NAME= TARUN SINGH BHADORIYA CLASS=. 10TH (A) ROLL NUMBER= 26 SUBMITTED TO: SUBMITTED BY: MS. DEEPALI AROTA TARUN SINGH BHADORIYA 1. Write a Python code to calculate Simple Interest if the PRINCIPAL AMOUNT= 2000, RATE OF INTEREST = 8 and TIME = 10. 2. Write a Python code to calculate Area of a triangle with Base and Height. 3. Write a Python code to check whether a person is eligible to vote or not. 4, Write a Python code to assign the Grade based on the given percentage. 5. Write a program to print a multiplication table of the entered number. 6. Write a program to check whether the given character is an uppercase letter or lowercase letter ora digit or a special character. 7. Write a program to find the maximum number out of the given three numbers. 8 Write a program to create a list and display list elements. 9. Write a program to add the elements of the two lists. 110. Create a list in Python of children selected for science quiz with following namesArjun, Sonakshi, Vikram, Sandhya, Sonal, Isha, Kartik Perform the following tasks on the list in sequence- ‘© Print the whole list ‘© Delete the name “Vikram” from the list ‘© Add the name “Jay” at the end ‘© Remove the item which is at the second position. 1L1. Python Program to Find the Factorial of a Number. 12. Python Program to Find the Largest Among Three Numbers. 13. Python Program to Check if a Number is Positive, Negative, or 0. 14. Write a program that classifies a person as a child, teenager, adult, or senior based on their age. 15. Create a program that generates a list of squares of numbers from 1 to 10 using list comprehension. +16. Write a program that checks whether a given letter is a vowel or a consonant. 17. Write a program that allows the user to create a shopping list. The user should be able to add items, view the list, and remove items. Implement append () and remove () methods. 18. Create a program that allows the user to enter a list of names and then insert a new name at 3 specific index. Handle any potential index errors. 19. Write a program that creates a tuple contai the tuple 20. Write a program that creates a dictionary to store information about a person (name, age, and city). Print the dictionary. Create a dictionary with three key-value pairs representing a book (title, author, year). ig the names of five of your favourite movies. Print ‘Write a program to access and print each value. ACKNOWLEGDEMENT lextent my sincere thaws to all the individuals awd organizations who have contributed to the successful completion of this covaputer project. Their valuable inputs and suggestions significantly improved the quality of have vay work. lam also indebted to my computer teacher for their collaboration and hard work, which have been vital to the project’s accomplishments. Finally, | would Lie to express my gratitude to my mentors for their guidance and support throughout this Journey. principle amount rate_of_interest time = 10 2000 Hou o simple_interest = (principle_amount * rate_of interest #4 Iprint("Simple Interest is:", simple interest) Bas @eG9 gua: 2 oe Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f or more information. >>> = RESTART: C:/Users/Lenovo/program 1.py Simple Interest is: 1600.0 >>> on. Boos we Bua€ - lbase=int (input ("enter the base of the triangle")) area=(0.5) *base*height print('the area of triangle is',area) 80 He yt Bas #580 @8n0O+ Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f or more information. >>> = RESTART: C:/Users/Lenovo/program 2.py enter the height of the triangle6 enter the base of the triangle5 the area of triangle is 15.0 >>>| es wea we OO gua- E980 ut age = int(input("Enter your age") )| if age >= 18: print("You are eligible to vote.") lelse: print("You are not eligible to vote.") as. Base atO9 Buao- 28 FFD nan Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f or more information. >>> = RESTART: C:/Users/Lenovo/program 3.py Enter your agel6 You are not eligible to vote. >>>| as wae wb O09 gua. - percentage = float(input("Enter your percentage: ")) if percentage >= 90: grade = "A+" elif percentage >= 80: grade = "A" elif percentage >= 70: grade = "B" elif percentage >= 60: grade = "'C" elif percentage >= 50: grade = "D" else: grade = "F"| print("Your grade i: :", grade) as Bas #600 gua 267 e90 Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f£ or more information. >>> = RESTART: C:/Users/Lenovo/program 4.py Enter your percentage: 74 Your grade is: B >>> as Boas #600 mua. - mumber = int(input("Enter the number: ")) jprint(f£"Multiplication table of {number}:") for i in range(1, 11): print (£"{number} x {i} = {number * i}") Basu we OO Bas or more information. [>>> == RESTART: C:/Users/Lenovo/program 5.py = Enter the number: 25 Multiplication table of 25: 25 x HPOeMeIDHe®WNH N a RRR KKK KKK Bas #6 O09 gua - character = input("Enter a character: ") if character.isupper(): print("The character is an uppercase letter.") elif character.islower(): print("The character is a lowercase letter.") elif character.isdigit(): print("The character is a digit.") lelse: print("The character is a special character.") a Boss wb 80 ena s 20% 980 we Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f£ or more information. >>> = RESTART: C:/Users/Lenovo/program 6.py Enter a character: A The character is an uppercase letter. >>>| oo Boas #600 gua 7 i" Inuml = float(input("Enter the first number: ")) num2 float (input ("Enter the second number: ")) num3 float(input("Enter the third number: ")) max_num = max(numl, num2, num3) print (£"The maximum number is: {max_num}") or. rice wb OO guao-: 20% 9 He an Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f£ or more information. >>> = RESTART: C:/Users/Lenovo/program 7.py Enter the first number: 45 Enter the second number: 89 Enter the third number: 32 The maximum number is: 89.0 >>> si ir #6 O09 gua -6 list = [10, 20, 30, 40, 50] iprint("The elements of the list are:") for element in list: print (element)| a0 F940 ye ase we O9 szali Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f or more information. >>> = RESTART: C:/Users/Lenovo/program8.py The elements of the list are: om Boas #600 exo -6 Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22 :03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" f£ or more information. >>> list1=[1,2,3] >>> list2=[4,5,6] >>>listl+list2 [1, 2, 3, 4, 5, 6] >>>| Bas #.O9 suas - Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> children = ["Arjun", "Sonakshi", "Vikram", "Sandhya", "Sonal", "Isha", " Kartik"] >>> print (children) ['Arjun', 'Sonakshi', 'Vikram', 'Sandhya', 'Sonal', 'Isha', 'Kartik'] >>> children. remove ("Vikram") >>> print (children) ['Arjun', 'Sonakshi', ‘Sandhya’, 'Sonal', ‘Isha', 'Kartik'] >>> children. append ("jay") >>> print (children) ['Arjun', 'Sonakshi', 'Sandhya', 'Sonal', ‘Isha', 'Kartik', 'jay'] >>> children .pop (1) *Sonakshi' >>> print (children) ['arjun', ‘Sandhya’, ‘Sonal', ‘Isha’, ‘Kartik’, ‘jay'] >>> ex mam we O09 guas 26 248 ne Inum = int (input ("Enter a number: ")) if num < 0: print("Factorial is not defined for negative numbers.") elif num == 0 or num == 1: print(£"The factorial of {num} is 1. else: factorial = 1 for i in range(1, num + 1): factorial *= i print (£"The factorial of {num} is (factorial).") ex Par wu BO gua. a F cue Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/program11.py Enter a number: 5 The factorial of 5 is 120. >>> ex mas we O09 guas 26% 948 nn Inuml = float (input ("Enter the first number: ")) Inum2 = float(input ("Enter the second number: ")) Inum3 = float(input("Enter the third number: ")) A£ num1 >= num2 and num1 >= num3: largest = numl elif mum2 >= numl and num2 >= num3: largest = num2 else: largest = num3 [print (£"The largest number among {num1}, B= Pr m~uBo {num2}, and {num3} is {largest}.") oe er Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/program12.py Enter the first number: 15 Enter the second number: 25| Enter the third number: 45 The largest number among 15.0, 25.0, and 45.0 is 45.0. >>> ex mas we OO guas 26 F988 ne num = float(input ("Enter a number: ")) if num > 0: print (f"The number {num} is positive.") elif mum < 0: print(£"The number {num} is negative.") else: print ("The number is zero I ok Boome m~uBo Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/pprogram13.py Enter a number: -1 The number -1.0 is negative. >>> ex mam we O09 guas +67 eae ten tose Br oe = age = int (input ("Enter the age: if age < 0: print ("Age elif age <= 12: print("The person is a Child. elif age <= 19: print ("The person is a Teenager jelif age <= 59: print("The person is an Adult.") else: not be negative.") print("The person is a Senior.") ex Bae wu BO gua oe ere Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/program14.py Enter the age: 17 The person is a Teenager. >>> ex mas we O09 guas 67 eae squares = [x**2 for x in range(1, 11)] print ("List of squares from 1 to 10:", squares) ex Bae mu BO uO er ere Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> RESTART: C: /Users/Lenovo/program16.py List of squares from 1 to 10: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] >>> ex mam we OO guas 26% 948 ane letter = input("Enter a letter: ").lower() if len(letter) == 1 and letter.isalpha(): if letter in ‘aeiou': print(£"'{letter}' is a vowel else: print(£"'{letter}' is a consonant.") jelse: print ("Invalid input. Please enter a single letter ex Bas #b BO l@nO+ 20% 40 te Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> RESTART: C: /Users/Lenovo/program16.py sx wae @eO0 euea- 30% ome an shopping_list=["football”, "studs", "jersey"] item=input ("enter an item to add:") shopping_list.append (item) print (shopping_list) item_to_remove=input ("enter an item to remove shopping_list. remove (item_to_remove) print (shopping_list)| ex ice @uBO gua: 26 9 8® te Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/program17..py enter an item to add:waterbottle ['football', ‘studs', ‘jersey', 'waterbottle'] enter an item to remove: studs ['football', ‘jersey', 'waterbottle'] >>> on am «eB gues 06 FF 8© une list=["kk", "samridhi", "shanvi","shiv"] list. insert (2, "princess") print (list)| = Bom @n BO BEG 26 Fee Python 3.12.1 (tags/v3.12.1:2305ea5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on © win32 Type “help", "copyright", "credits" or "license()" for more information. >>> werner eeeneeeenaeenseeaaaa= RESTAR! \Users\Lenovo\programl® py —========maanmmmnnnmnnnan ('kk', ‘samridhi', ‘princess’, 'shanvi', ‘shiv'] = ices een OB0 gua. a ose Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32 Type "help", "copyright", >>> favorite_movies=("salaar","my fault" >>> print (favorite_movies) (salaar', ‘my fault', ‘bahubali', >>> "eredits" or "license()" for more information. hubali", "animal", "kalki 2898ad") ‘animal’, 'kalki 2898ad') Fo 0w wt ex mam 580 euas 2 peptone 08H fperson_infom{'name':‘tarun', ‘age':'16', ‘city’: 'gwalior'} (print (person_info) morgan housel', ‘year! :'2020'} Ibook_ingo={‘name':'the psychology of money', ‘author': [print (book_info) Bos 6s O80 BEos -0% Python 3.12.1 (tags/v3.12.1:2305ea5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on © win32 Type “help", "copyright", "credits" or "license()" for more information. >>> = RESTART: C:/Users/Lenovo/program20.py (*name'; ‘tarun', 'age': '16", ‘city’: ‘gwalior') (’name!': ‘the psychology of money', ‘author!: ‘morgan housel', 'year': '2020') >>> Bass ee B89 (eae. +a % eee CONCLUSION tw conclusion, Artificial intelligence, ranging from narrow Al to supertntelligent Al, has profounaly impacted various sectors, from healthcare to transportation. Its ability to analyse vast amounts of data and make predictions has led to increased efficiency ano new opportunities. However, it also presents ethical challenges that_we must navigate carefully. As we move forward, it is eruetal to continue researching and developing Al im a responsible manner, ensuring that it serves as a tool for human betterment while mitigating potential risks.

You might also like