menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
What is the difference between a loop and a function?
asked
Sep 17, 2023
31.4k
views
2
votes
What is the difference between a loop and a function?
Computers and Technology
high-school
Brian Hinchey
asked
by
Brian Hinchey
4.6k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
13
votes
Simple definition
A loop is a code that will repeat again and again until the condition is true. If the condition become false the loop will stop executing.
A function is a code that will do a particular task when you call it. First you need to define a function which is known as function definition. And whenever you want to use it then you have to call the function.
If you don’t call the function then it will not work what you want.
Hope you like this
Locket
answered
Sep 19, 2023
by
Locket
4.4k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
0
votes
Big difference
Loops allow you to execute code multiple times while a condition is true
Functions allow you to “call” a snippet of code whenever you want, and you can pass it arguments that could affect the data it returns
Urraka
answered
Sep 22, 2023
by
Urraka
4.5k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
4.5m
questions
5.9m
answers
Other Questions
Assume you have created a mechanical arm that can hold a pen. The arm can perform the following tasks: • Lower the pen to a piece of paper. • Raise the pen from the paper. • Move the pen 1 inch along a
Drag each connector name to match the connector type shown.
In which part is data processing done?
What is the maximum throughput of a homogeneous pipeline in which four processors each handle one million instructions per second and processing a data item requires 50, 60, 40, and 30 instructions, respectively?
What problem does chlorofluorocarbon (CFC) create? a. it causes lead poisoning b.it causes great damage to the ozone layer c. it leaks into food as it cools the air and refrigerators d. it is responsible
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org