SlideShare a Scribd company logo
1 of 12
Python
Session-05
Homework
Q1:
3
⬥ Create a function that print your full name, your
age and your collage.
⬥ Then call a function at the body of your code
Q2:
4
⬥ Create a function that print your full name, your
age and your collage by using Non-default
arguments
Q3:
5
⬥ Write a Python program to print the even
numbers from a given list
⬥ Sample List : [1, 2, 3, 4, 5, 6, 7, 8, 9]
⬥ Expected Result : [2, 4, 6, 8]
Q4:
6
⬥ Write a Python function that takes a number as
a parameter and check the number is prime or
not
Q5:
7
⬥ Write a Python function to calculate the
factorial of a number (a non-negative integer).
The function accepts the number as an
argument
Q6:
8
⬥ Create a function showEmployee() in such a way
that it should accept employee name, and it’s
salary and display both, and if the salary is
missing in function call it should show it as
9000
Q7:
9
⬥ Write a function func1() such that it can accept a
variable length of argument and print all
arguments value
Q8:
10
⬥ Write a function calculation() such that it can
accept two variables and calculate the addition
and subtraction of it.
⬥ And also it must return both addition and
subtraction in a single return call
Q9:
11
⬥ Write a recursive function to calculate the sum
of numbers from 0 to 10
THANKS!
ANY QUESTIONS?
12

More Related Content

Similar to Python_Session05_Homeworkquestions.pptx

csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structuresMicheal Ogundero
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdfziyadaslanbey
 
Class7 term3 2019-2020
Class7 term3 2019-2020Class7 term3 2019-2020
Class7 term3 2019-2020Andrew Raj
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsash52393
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsshyaminfo04
 
Dive into Python Functions Fundamental Concepts.pdf
Dive into Python Functions Fundamental Concepts.pdfDive into Python Functions Fundamental Concepts.pdf
Dive into Python Functions Fundamental Concepts.pdfSudhanshiBakre1
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docxrafbolet0
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience App Ttrainers .com
 
Master Python in 15 Days.pdf
Master Python in 15 Days.pdfMaster Python in 15 Days.pdf
Master Python in 15 Days.pdfJorgeTorres560505
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The BasicsRanel Padon
 
Dynamic Function Call in PI Sheet (XStep)
Dynamic Function Call in PI Sheet (XStep)Dynamic Function Call in PI Sheet (XStep)
Dynamic Function Call in PI Sheet (XStep)Ankit Sharma
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsgovendaagoovenda
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsnoahjamessss
 
Python Introduction Week-1 Term-3.pptx
Python Introduction Week-1 Term-3.pptxPython Introduction Week-1 Term-3.pptx
Python Introduction Week-1 Term-3.pptxMohammad300758
 

Similar to Python_Session05_Homeworkquestions.pptx (20)

csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Class7 term3 2019-2020
Class7 term3 2019-2020Class7 term3 2019-2020
Class7 term3 2019-2020
 
P3
P3P3
P3
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Dive into Python Functions Fundamental Concepts.pdf
Dive into Python Functions Fundamental Concepts.pdfDive into Python Functions Fundamental Concepts.pdf
Dive into Python Functions Fundamental Concepts.pdf
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience
 
Master Python in 15 Days.pdf
Master Python in 15 Days.pdfMaster Python in 15 Days.pdf
Master Python in 15 Days.pdf
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The Basics
 
Dynamic Function Call in PI Sheet (XStep)
Dynamic Function Call in PI Sheet (XStep)Dynamic Function Call in PI Sheet (XStep)
Dynamic Function Call in PI Sheet (XStep)
 
Presentation 2.pptx
Presentation 2.pptxPresentation 2.pptx
Presentation 2.pptx
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Python Introduction Week-1 Term-3.pptx
Python Introduction Week-1 Term-3.pptxPython Introduction Week-1 Term-3.pptx
Python Introduction Week-1 Term-3.pptx
 

More from samaghorab

Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfsamaghorab
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfsamaghorab
 
Lec_1_Integration.ppt
Lec_1_Integration.pptLec_1_Integration.ppt
Lec_1_Integration.pptsamaghorab
 
Chapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfChapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfsamaghorab
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfsamaghorab
 
Intro_to_data_base.pdf
Intro_to_data_base.pdfIntro_to_data_base.pdf
Intro_to_data_base.pdfsamaghorab
 
programs+ifelse&+for.pptx
programs+ifelse&+for.pptxprograms+ifelse&+for.pptx
programs+ifelse&+for.pptxsamaghorab
 
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptxBioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptxsamaghorab
 

More from samaghorab (11)

Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
 
Lec_1_Integration.ppt
Lec_1_Integration.pptLec_1_Integration.ppt
Lec_1_Integration.ppt
 
L2Web.pptx
L2Web.pptxL2Web.pptx
L2Web.pptx
 
Chapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfChapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdf
 
L6.pdf
L6.pdfL6.pdf
L6.pdf
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
 
Intro_to_data_base.pdf
Intro_to_data_base.pdfIntro_to_data_base.pdf
Intro_to_data_base.pdf
 
5941981.ppt
5941981.ppt5941981.ppt
5941981.ppt
 
programs+ifelse&+for.pptx
programs+ifelse&+for.pptxprograms+ifelse&+for.pptx
programs+ifelse&+for.pptx
 
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptxBioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
 

Recently uploaded

Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdftimtebeek1
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Varun Mithran
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfkalichargn70th171
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...Neo4j
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmuxevmux96
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletAndrea Goulet
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfkalichargn70th171
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)Roberto Bettazzoni
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxNeo4j
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Flutter Agency
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14VMware Tanzu
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Henry Schreiner
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckMarc Lester
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMarkus Moeller
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksJinanKordab
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jNeo4j
 

Recently uploaded (20)

Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 

Python_Session05_Homeworkquestions.pptx

  • 3. Q1: 3 ⬥ Create a function that print your full name, your age and your collage. ⬥ Then call a function at the body of your code
  • 4. Q2: 4 ⬥ Create a function that print your full name, your age and your collage by using Non-default arguments
  • 5. Q3: 5 ⬥ Write a Python program to print the even numbers from a given list ⬥ Sample List : [1, 2, 3, 4, 5, 6, 7, 8, 9] ⬥ Expected Result : [2, 4, 6, 8]
  • 6. Q4: 6 ⬥ Write a Python function that takes a number as a parameter and check the number is prime or not
  • 7. Q5: 7 ⬥ Write a Python function to calculate the factorial of a number (a non-negative integer). The function accepts the number as an argument
  • 8. Q6: 8 ⬥ Create a function showEmployee() in such a way that it should accept employee name, and it’s salary and display both, and if the salary is missing in function call it should show it as 9000
  • 9. Q7: 9 ⬥ Write a function func1() such that it can accept a variable length of argument and print all arguments value
  • 10. Q8: 10 ⬥ Write a function calculation() such that it can accept two variables and calculate the addition and subtraction of it. ⬥ And also it must return both addition and subtraction in a single return call
  • 11. Q9: 11 ⬥ Write a recursive function to calculate the sum of numbers from 0 to 10