1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vilka [71]
2 years ago
7

What is the difference between a loop and a function?

Computers and Technology
2 answers:
Eduardwww [97]2 years ago
7 0
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
kykrilka [37]2 years ago
4 0
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
You might be interested in
Hoda wants to create a new presentation in PowerPoint with existing graphics and designs. What is the easiest and fastest way fo
Paul [167]

Answer: a

Explanation:

6 0
4 years ago
Which of the following is a benefit, as well as a risk, associated with client/server networks?
melomori [17]
A. IT professional, who maintains the network, must be added and removed from the network. - risk 
B. Clients work independently; therefore, if one computer is not working, other computers can still do their jobs.  - benefit (scalability is always a benefit)
C. Security levels are set up by individuals; therefore, these networks may not be as secure. - risk
D. There is no need for a big IT department to keep the network up and running. - benefit (it is simple for maintenance)
7 0
4 years ago
Read 2 more answers
When you open a stream for both reading and writing files, what must you always remember to do at the end?
Leona [35]

Answer:

When you open a stream for both reading and writing you must always remember to close the stream.

Explanation:

There are three basic steps to follow to read and write data from stream.

Steps to read data from the stream

1) Open the stream

2) Read the data from the stream

3) Close the stream

Step to write data to the stream

1) Open the stream

2) Write the data to the stream

3) Close the stream

6 0
4 years ago
Java Programming home > 1.14: zylab training: Interleaved input/output Н zyBooks catalog Try submitting it for grading (click
Andru [333]

Answer:

The following are the code to this question:

code:

System.out.println(x);  //use print method to print value.

Explanation:

In the given question, it simplifies or deletes code in the 11th line. This line has a large major statement.  

In the case, the tests fail because only 1 line of output is required by the tester, but two lines are obtained instead.

It's to demonstrate that the input/output or testing requirements function throughout the model.

5 0
4 years ago
I’m failing this class and i’m stuck on this one, this is the code from the last lesson:
serg [7]

lst=([])

def avgGPA(lst1):

   total = 0

   count = 0

   for x in lst:

       if type(x) == int:

           total += x

           count += 1

   return total/count

def GPAcalc(grade, weighted):

   grade = grade.lower()

   dictionary = {"a": 4, "b": 3, "c": 2, "d": 1, "f": 0}

   if weighted == 1 and grade in dictionary:

       lst.append(dictionary[grade]+1)

       return "Your GPA score is: " + str(dictionary[grade] + 1)

   elif weighted == 0 and grade in dictionary:

       lst.append(dictionary[grade])

       return "Your GPA score is: " + str(dictionary[grade])

   else:

       lst.append("Invalid")

       return "Invalid"

classes = int(input("How many Classes are you taking? "))

i = 0

while i < classes:

   print(GPAcalc(input("Enter your Letter Grade: "), int(input("Is it weighted? (1 = yes) "))))

   i += 1

print("Your weighted GPA is a "+str(avgGPA(lst)))

If you need me to change any code, I'll do my best. I hope this helps!

6 0
3 years ago
Other questions:
  • Barr the Bear has started a business to sell fish to Poe and his fellow penguins. The penguin customers submit many fish orders,
    12·1 answer
  • A search engine is the same as a browser.<br> \
    11·1 answer
  • ​Kendra is taking a class in Finance and she has been asked to give a speech about a case study in which she's been working. She
    10·1 answer
  • The requester of sensitive information should not receive access just because of his or her clearance, position, or rank. The re
    15·1 answer
  • Which computer network component connects two different networks together and allows them to communicate?
    8·2 answers
  • All the following are the basis of the World Wide Web except:
    14·2 answers
  • Green Fields Landscaping Company sells evergreen trees which are priced by height. Customers have a choice of purchasing a tree
    15·1 answer
  • HTML, the markup language of the web, specifies colors using the RGB model. It uses a two-digit hexadecimal (that is, base 16) r
    13·1 answer
  • Which statement about broadcasting a slideshow online is true?
    14·2 answers
  • You are configuring NIC Teaming on a Windows Server system using two physical network adapters. You want to aggregate the bandwi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!