SlideShare a Scribd company logo
Python is a well-liked programming language. It was
developed by Guido van Rossum in 1991. It is used for
web development (server-side), software development,
mathematics, system scripting. Python was designed for
readability, and has some similarities to the English
language with manipulate from mathematics.
 Program:
 def fact(n):
 if n == 0:
 return 1
 else:
 return n * fact(n-1)
 n=int(input("Enter a number for compute the
factorial : "))
 print(fact(n))
 Output:
 Enter a number for compute the factorial : 4
 24
 Program:
 import numpy as np
 x = np.array([1,2,3,4,5,7,2,1,1,1,8,9,1])
 print(x)
 print("most frequent value in the list:")
 print(np.bincount(x).argmax())

 Output:

 [1 2 3 4 5 7 2 1 1 1 8 9 1]
 most frequent value in the list:
 1

 Program:
 print("Enter words separated by Hyphens : ")
 lst = [n for n in input().split("-")]
 lst.sort()
 print('-'.join(lst))

 Output:
 Enter words separated by Hyphens :
 gaurav-ram-yashir-bittu-wong
 bittu-gaurav-ram-wong-yashir
 Program:
 def data(lst1, lst2):
 result = False
 for i in lst1:
 for j in lst2:
 if i == j:
 result = True
 return result
 print(data([1,2,3,4,5], [5,6,7,8,9,10]))
 Program:
 def fab(x):
 if x<2:
 return 1
 else:
 return fab(x-1)+fab(x-2)
 y=int(input("Enter a number :"))
 for i in range(y):
 print(i, "=", fab(i))

 Program:
 a = int(input("Enter the first number: "))
 b = int(input("Enter the second number: "))
 product = 0
 for i in range(b):
 product= product+a
 print(product)
 Output:
 Enter the first number: 3
 Enter the second number: 4
 12
 Program:
 Hello Students this program is very useful for O Level Practical so
read it carefully.
 def power(x,y):
 if y==0:
 return 1
 else:
 return x * power(x, y-1)
 x = float(input("Enter a value of base: "))
 y = int(input("Enter value of exponent: "))
 result = power(x, y)
 print(result)
 Output:
 Enter a value of base: 2
 Enter value of exponent: 3
 8.0
 mydict = {'raj': 5, 'raja': 6,
 'sanju': 7, 'mohan': 2, 'surya': 10}
 Keys = list(mydict.keys())
 Keys.sort()
 sort_dict = {i: mydict[i] for i in Keys}
 print(sort_dict)
 list = []
 num = int(input("Enter number of elements in list: "))
 for i in range(1, num + 1):
 a = int(input("Enter elements: "))
 list.append(a)
 print("Largest element is:", max(list))
 Output:
 Enter number of elements in list: 3
 Enter elements: 19
 Enter elements: 13
 Enter elements: 88
 Largest element is: 88
 More python Program click below link
 https://www.careerbodh.in/blog/categories/python-program


More Related Content

What's hot

Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
OmRanjan2
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shop
Yash Panwar
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
lokesh meena
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
YugenJarwal
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
Ashwin Francis
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
Harsh Kumar
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
HarshitSachdeva17
 
Computer Practical
Computer PracticalComputer Practical
Computer PracticalPLKFM
 
Project report
Project reportProject report
Project report
VISHAL VERMA
 
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
Vishvjeet Yadav
 
Chemistry investigatory project on Antacids
Chemistry investigatory project on Antacids Chemistry investigatory project on Antacids
Chemistry investigatory project on Antacids
Vinay Gupta
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
Anushka Rai
 
computer science project on movie booking system
computer science project on movie booking systemcomputer science project on movie booking system
computer science project on movie booking system
Anurag Yadav
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
ArkaSarkar23
 
Physics activity file Class 12 - Saksham
Physics activity file Class 12 - SakshamPhysics activity file Class 12 - Saksham
Physics activity file Class 12 - Saksham
Saksham Mittal
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
AbhishekKumarMorla
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
Shahban Ali
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22
manyaarora19
 
Bahan Ajar Pemrograman Assembly
Bahan Ajar Pemrograman Assembly Bahan Ajar Pemrograman Assembly
Bahan Ajar Pemrograman Assembly
Igun
 

What's hot (20)

Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 
CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL CBSE Class 12 Computer practical Python Programs and MYSQL
CBSE Class 12 Computer practical Python Programs and MYSQL
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shop
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
Computer Practical
Computer PracticalComputer Practical
Computer Practical
 
Project report
Project reportProject report
Project report
 
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
CBSE class 12th Chemistry project on antacids for cbse aissce 2017-2018
 
Chemistry investigatory project on Antacids
Chemistry investigatory project on Antacids Chemistry investigatory project on Antacids
Chemistry investigatory project on Antacids
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
computer science project on movie booking system
computer science project on movie booking systemcomputer science project on movie booking system
computer science project on movie booking system
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
 
Physics activity file Class 12 - Saksham
Physics activity file Class 12 - SakshamPhysics activity file Class 12 - Saksham
Physics activity file Class 12 - Saksham
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22
 
Bahan Ajar Pemrograman Assembly
Bahan Ajar Pemrograman Assembly Bahan Ajar Pemrograman Assembly
Bahan Ajar Pemrograman Assembly
 

Similar to Python program For O level Practical

python practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdfpython practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdf
rajatxyz
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
Prof. Dr. K. Adisesha
 
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdfsolution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
parthp5150s
 
python file for easy way practicle programs
python file for easy way practicle programspython file for easy way practicle programs
python file for easy way practicle programs
vineetdhand2004
 
xii cs practicals
xii cs practicalsxii cs practicals
xii cs practicals
JaswinderKaurSarao
 
Python summer course play with python (lab1)
Python summer course  play with python  (lab1)Python summer course  play with python  (lab1)
Python summer course play with python (lab1)iloveallahsomuch
 
Python summer course play with python (lab1)
Python summer course  play with python  (lab1)Python summer course  play with python  (lab1)
Python summer course play with python (lab1)iloveallahsomuch
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
srxerox
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
Arockia Abins
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
simenehanmut
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
Abdul Haseeb
 
Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
Abdul Haseeb
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
vikram mahendra
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
SulbhaGath1
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
SulbhaGath1
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
SulbhaGath1
 
python lab programs.pdf
python lab programs.pdfpython lab programs.pdf
python lab programs.pdf
CBJWorld
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9alish sha
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
RamziFeghali
 

Similar to Python program For O level Practical (20)

python practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdfpython practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdf
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
 
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdfsolution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
 
python file for easy way practicle programs
python file for easy way practicle programspython file for easy way practicle programs
python file for easy way practicle programs
 
xii cs practicals
xii cs practicalsxii cs practicals
xii cs practicals
 
Python summer course play with python (lab1)
Python summer course  play with python  (lab1)Python summer course  play with python  (lab1)
Python summer course play with python (lab1)
 
Python summer course play with python (lab1)
Python summer course  play with python  (lab1)Python summer course  play with python  (lab1)
Python summer course play with python (lab1)
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
 
140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...140+ Basic Python Programs This resource can assist you in preparing for your...
140+ Basic Python Programs This resource can assist you in preparing for your...
 
python lab programs.pdf
python lab programs.pdfpython lab programs.pdf
python lab programs.pdf
 
Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
 

Recently uploaded

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 

Python program For O level Practical

  • 1. Python is a well-liked programming language. It was developed by Guido van Rossum in 1991. It is used for web development (server-side), software development, mathematics, system scripting. Python was designed for readability, and has some similarities to the English language with manipulate from mathematics.
  • 2.  Program:  def fact(n):  if n == 0:  return 1  else:  return n * fact(n-1)  n=int(input("Enter a number for compute the factorial : "))  print(fact(n))  Output:  Enter a number for compute the factorial : 4  24
  • 3.  Program:  import numpy as np  x = np.array([1,2,3,4,5,7,2,1,1,1,8,9,1])  print(x)  print("most frequent value in the list:")  print(np.bincount(x).argmax())   Output:   [1 2 3 4 5 7 2 1 1 1 8 9 1]  most frequent value in the list:  1 
  • 4.  Program:  print("Enter words separated by Hyphens : ")  lst = [n for n in input().split("-")]  lst.sort()  print('-'.join(lst))   Output:  Enter words separated by Hyphens :  gaurav-ram-yashir-bittu-wong  bittu-gaurav-ram-wong-yashir
  • 5.  Program:  def data(lst1, lst2):  result = False  for i in lst1:  for j in lst2:  if i == j:  result = True  return result  print(data([1,2,3,4,5], [5,6,7,8,9,10]))
  • 6.  Program:  def fab(x):  if x<2:  return 1  else:  return fab(x-1)+fab(x-2)  y=int(input("Enter a number :"))  for i in range(y):  print(i, "=", fab(i)) 
  • 7.  Program:  a = int(input("Enter the first number: "))  b = int(input("Enter the second number: "))  product = 0  for i in range(b):  product= product+a  print(product)  Output:  Enter the first number: 3  Enter the second number: 4  12
  • 8.  Program:  Hello Students this program is very useful for O Level Practical so read it carefully.  def power(x,y):  if y==0:  return 1  else:  return x * power(x, y-1)  x = float(input("Enter a value of base: "))  y = int(input("Enter value of exponent: "))  result = power(x, y)  print(result)  Output:  Enter a value of base: 2  Enter value of exponent: 3  8.0
  • 9.  mydict = {'raj': 5, 'raja': 6,  'sanju': 7, 'mohan': 2, 'surya': 10}  Keys = list(mydict.keys())  Keys.sort()  sort_dict = {i: mydict[i] for i in Keys}  print(sort_dict)
  • 10.  list = []  num = int(input("Enter number of elements in list: "))  for i in range(1, num + 1):  a = int(input("Enter elements: "))  list.append(a)  print("Largest element is:", max(list))  Output:  Enter number of elements in list: 3  Enter elements: 19  Enter elements: 13  Enter elements: 88  Largest element is: 88  More python Program click below link  https://www.careerbodh.in/blog/categories/python-program 