When do you use a for loop?

Answers

Answer 1

Answer:

You use a for loop when you know how many times you want to run the loop

Explanation:

if you dont know, use a while loop


Related Questions

A restaurant recorded the ages of customers on two separate days. You are going to write a program to compare the number of customers in their teens (ages 13 to 19).

What is the missing line of code to count the number of customers in their teens?

customerAges = [13, 3, 11, 24, 35, 25, 15, 18, 1]
countTeens = 0
for item in customerAges:
_____:
countTeens = countTeens + 1

if 13 <= item <= 19

if 13 < item < 19

if 13 <= item[0] <= 19

if 13 < item[0] < 19

Answers

Answer:

if 13 <= item <= 19

Explanation:

Edge 2021

The missing line of code to count the number of customers in their teens is if 13 <= item <= 19. The correct option is b.

What is programming?

A form of computer programming language known as procedural programming describes a number of well-planned actions and processes during the course of its development.

It includes statements, functions, and commands that are organized systematically to finish a computing task or program. Its main focus is on developing procedures.

While object-oriented programming is a type of programming where the emphasis is on generating objects as opposed to actions and data or logic. Inheritance, polymorphism, abstraction, and encapsulation are its four guiding concepts.

Therefore, the correct option is b, if 13 <= item <= 19

To learn more about programming, refer to the link:

https://brainly.com/question/14368396

#SPJ2

HELP ME!!! I WILL GIVE BRAINLY THINGY!!!

What does the code if (num2==50){ do?

Answers

Answer:

What subject is this?

Explanation:

is this math ?????????????????????

Can we trust in Avast Antivirus ⊕?⊕

Answers

Answer:

yes we can

Explanation:

im also using avast antivirus and it was no fault in avast antivirus

Answer:

Avast is a good antivirus program. It is not a scam or malware. I personely use Avast a while back and they are now basically the same thing, only with a different user interface.

Explanation:

Hope It's answer you plz mark as Brainlist

Describe the purpose and user requirements for the website.​

Answers

Answer:

The purpose and user requirements for the website is described below in details.

Explanation:

User Requirements represent how user expectations and wherewith they will communicate with the outcome. Use the characteristics, functions, and content expressed in your summaries to elaborate on your requirements. Your user synopses should describe the responsibilities your users want to perform on your site.

What is the difference between an if-statement, an if-else statement, and an if-else-if statement? How are they similar?

This is in computer science principles

Answers

Answer:

Explanation:

If statement is saying one perspective. However, if else if is many different.

100 pints
Question # 1 Match List You have used different ways to store data. Match each definition with its type.

movieCost = 4.95

movieStars = ['Carrie Fisher', 'Harrison Ford']

movie = 'Star Wars'

movieID = 132

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild') movieRatings = {5:'language', 3:'violence'}


words that needs to be used

string

int

float

list

dictionary

turple

Answers

Answer:

movieCost=4.95

Float

movieStars = ['Carrie Fisher', 'Harrison Ford']

List

movie= 'Star Wars'

String

movieID=132

int

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild')

Tuple

movieRatings = {5:'language', 3:'violence'}

Dictionary

Explanation:

movieCost = 4.95

movieCost  is of float type because it has a decimal point.

movieStars = ['Carrie Fisher', 'Harrison Ford']

movieStars if of list type because in Python the elements of list is inside square brackets.

List is an ordered collection. List is mutable i-e items can be added and remved from the list

movie = 'Star Wars'

movies is a string type because it is in enclosed in single quotes only.

movieID = 132

movieID is of int type because it is only number, without decimal value.

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild')

movieAwards is a tuple type because it is enclosed in round brackets or parenthesis.

Tuple is a sequence object. It is ordered collection of item. it is immutable.

movieRatings = {5:'language', 3:'violence'}

MovieRating is a dictionay type because it is in key-value pair. it is an unordered collection.

What routing protocol is the most popular distance-vector routing algorithm used to determine the best routes within a network

Answers

Answer:

RIP

Explanation:

RIP is a routing protocol that stands for Routing Information Protocol. It is a distance-vector routing algorithm which uses a hop count for routing its metric. RIP is the most popular and frequently used on internet. RIP uses hop count, which means it goes from low hop count to high hop count.

Therefore, it is the Routing Infomation Protocol which is the most popular distance-vector routing algorithm used to determine the best routes within a network.

put each sentence in the correct place please :)

Answers

the first image matches with the last sentence.

the second image (fireworks) match with the first sentence.

the third image (rocket) matches with sentence two.

and the last image matches the third sentence.

Answer:

sentence 1 -> picture in box 2

sentence 2 -> picture in box 3

sentence 3 -> picture in box 4

sentence 4 -> picture in box 1

how do I take a picture of myself on an apple computers?

Answers

Answer:

with the camera

Explanation:

Answer:

press the camera and take a pic??

Explanation:

What is the purpose of slicing?

a. To combine characters in order to form a single string
b. To combine two or more strings into one big string
c. To pull out a group of characters from a string
d. To pull out one specific character from a string

Answers

Answer:

C

Explanation:

Because a and b are talking about combining and when you slice you don't combine when you slice and when you slice something its into 2 or more parts, unlike what d says

write a c++ program that prints the intial letter of any name​

Answers

Answer:

#include<iostream>

using namespace std;

int main(){

char str[20];

int i=0;

std::cout<<"Enter a name:" ;

cin>>str;

cout<<*str;

while(str[i]!='\0'){

if(str[i]==' '){

i++;

cin>>*(str+i);

}

i++;

}

return 0;

}

Categorize each memory card as based on new or old technology. PLEASE HELP.

Answers

Answer:

SD Cards and XDQ Cards are new XD Cards and CF Cards are old.

Explanation:

Hope this helps.

What are the two negative impacts of computer technology to the society?​

Answers

One negative is that people are getting very impatient. This is because people are getting used to things instantly coming up onto their screens. Another negative is that people are being manipulated more easily. Nowadays anyone can be an expert if they sound smart enough. Then they can spread their lies quickly to millions of people.

Why are backlinks a useful way to see if information on a website is reliable

Answers

Answer: It would help because the backlink could have the necessary details about the information being told. Hope it helps!

Which of the following identifies the most appropriate courses to take in high school for someone interested in becoming a mechanical engineer?
drafting- and math-related courses
math- and science-related courses
computer- and design-related courses
science- and computer-related courses

Answers

Answer: New questions in Health

Which member of the multidisciplinary team would help a patient improve his flexibility in the joints after a knee-replacement surgery? A. a physiot…

What are two advantages of a multidisciplinary team approach? better diagnosis in complex cases shared responsibility for decisions more opportunit…

MARKING PEOPLE AS BRAINLIST PLEASEEE HELP Where is the carbon dioxide picked up and the oxygen unloaded in the body? A:Arteries B:Veins C:Capillar…

Which healthcare professional would be primarily responsible for treating a patient for his anxiety disorder after a surgery? A. a nurse B. a nutr…

Do Now: What might be a situation where it might be important to identify 3 points somebody? What are different strategies that scientists could use …

Explanation:

Do saving and loans associations have different categories?

Answers

Answer:

No

Explanation:

Because Savings and loan associations (S&Ls) are one of four types of "banks", there only one of four, not two of four

What will you see on the next line?

>>> aList = [12, 3, 5, 7, 7]
>>> aList.index(7)

1

7

3

2

Answers

Answer:

its 3, just did it on edg 2020

Explanation:

sdfdsfdsfdsfsdfsdf vote me brainliest!

The next line after >>> aList = [12, 3, 5, 7, 7], >>> aList.index(7) is 3. The correct option is c.

What is an array?

A group of identical objects or pieces of data held near to one another in memory is referred to as an array. An array type is a user-defined data type that consists of an ordered collection of objects of a single data type. Ordinary array types have a set maximum number of elements they can hold and use the ordinal position as the array index.

The unordered list that is a part of the simple array is thus visible. The unordered list can be converted to an ordered list by executing the command "aList. sort()".

So, the next line will be:

>>> aList = [12, 3, 5, 7, 7]

>>> aList.index(7)

3

Therefore, the correct option is c. 3.

To learn more about array, refer to the link below:

brainly.com/question/14915529

#SPJ2

In
the first computer ran a program from memory.
0 1942
1950
1948
1968

Answers

The first computer to run a program from memory was 1950.

What device is required to connect to the Internet?
O Wi-Fi
O an ISP
a router
a modem​

Answers

Answer:

modem

Explanation:

The primary piece of hardware you need is a modem. The type of Internet access you choose will determine the type of modem you need. Dial-up access uses a telephone modem, DSL service uses a DSL modem, cable access uses a cable modem, and satellite service uses a satellite adapter.

Answer:

D

Explanation:

Edg 2021

How do you do that ( the bit that I circled in the picture)

Answers

Answer: You just type answer, return/enter, put your answer and then hit return/enter again

Explanation:

short note on first generation computer​

Answers

Answer:

The period of first generation was from 1946-1959. The computers of first generation used vacuum tubes as the basic components for memory and circuitry for CPU

9. What will help you determine the kinds of tools, equipment and utensil you will assemble, sanitize, inspect or check?
a. the kind of product to be produced
b. the method of food processing to be done
c. the raw materials to be processed
d. the availability of tools, equipment and utensils​

Answers

Explanation:

b. the method of food processing to be done

anyone else parents take your phone and you ask for it nicely and they say no and you ask why and they ignore you

Answers

Answer:

that's the same situation with me but with other objects cuz me no have ph0nE

Explanation:

when i was a smol chiLd i would get beat if i didnt  know my multiplication table l0l

yes, hate it so much

What is output? Select all that apply.
C=0.
while (c < 5):
c = c + 1
print(c)

Answers

Answer:

Since we didn't print it at the beginning, we can assume that the program will start printing to the console at the number: 1. After that, it continues right before hitting 5. Proving the output of the program will be the following:

1

2

3

4

Question # 3

Dropdown

Finish the code for this bubble sort.

length = len(myList)

for n in range(length - 1):

for test in range(n + 1, length):

if myList[n] _____ myList[test]:

temp = myList[n]

myList[n] = myList [test]

myList[test] = temp

print(myList)

Answers

Answer:

The answer is >

Explanation:

I did the assignment on edge this was the correct answer

The complete code is length = len(myList), for n in range(length - 1):, for test in range(n + 1, length):, if myList[n] > myList[test]:.

What is coding?

Computer code, or a set of instructions or a system of rules defined in a specific programming language, is a term used in computer programming (i.e., the source code).

Although learning to code is not difficult, it might be scary at first. The initial stages of learning something new might be difficult. With practice, persistence, and patience, coding becomes simpler. If you're thinking about learning to code, it's simple to get caught up in the challenge.

Languages written in an imperative, functional, logical, or object-oriented style are common. These coding language paradigms are available for programmers to select from in order to best meet their demands for a given project.

Therefore, the correct term to complete the code bubble sort is >.

To learn more about coding, refer to the link:

https://brainly.com/question/20712703

#SPJ2

Submit a paragraph about how people earn income online.

Answers

Answer:

Selling services or products, generating traffic for ad revenue or investing in different types of products / companies.

Explanation:

Write a java program to read elements in an array from user and count total number of duplicate elements in array.

Answers

Answer:

Explanation:

The following code is written in Java and is a function/method that takes in an int array as a parameter. The type of array can be changed. The function then creates a counter and loops through each element in the array comparing each one, whenever one element is found to be a duplicate it increases the counter by 1 and moves on to the next element in the array. Finally, it prints out the number of duplicates.

public static int countDuplicate (int[] arr) {

               int count = 0;

               for(int i = 0; i < arr.length; i++) {

                       for(int j = i + 1; j < arr.length; j++) {

                               if(arr[i] == arr[j])

                                       count++;

                       }

               }

               return count;

       }

PLS HELP BEING TIMED!!!
Complete the following sentence.
The basics of managing money such as balancing a checkbook and making a budget are _____
skills

Answers

Answer:

Bank Rate skills

Explanation:

because it is i believe

Create a code for playing blackjack
The first part of the code will create two variable.
One for the first card you’re dealt and one for the second.
Add those two variable for the total score you have

Then
Create a while loop that will stop if your score becomes above 21 or if the user says that they wish to stay.
Inside the while loop have ask the user if they want to hit or stay. Inside of the question be sure to print the current total that the user has
If the user inputs “hit” add a random number between 1 and 11 to their score.
If they input “stay” then print their final score
Then
Create a code for the dealer
The dealer should also start with two cards (remember you can always copy and paste and then edit your code)
Create a while loop for the dealer. (there is rule that dealers must always hit if their total is 16 or under
Print the dealers score once they are done.

Finally
Check if your score is higher than the dealer’s.
If it is you win
If not, you lose

Remember.
If either the dealer or you reach over 21 then that person automatically loses

Answers

Answer:

import random

is_stay = 'n'

y_fcard = random.randint(1, 11)

y_scard = random.randint(1, 11)

d_fcard = random.randint(1, 11)

d_scard = random.randint(1, 11)

you_score = y_fcard + y_scard

dealer_s = d_fcard + d_scard

print("Your score", you_score)

print("dealer's score", dealer_s)

while is_stay == 'n':

   if you_score > 21:

       break

   you_score += random.randint(1, 11)

   print("Your score", you_score)

   is_stay = input("Do you want to stay y/n?: ")

   if you_score > 21:

       print("You lost")

       quit()

while dealer_s <= 16:

   dealer_s += random.randint(1, 11)

   if dealer_s > 21:

       print("The dealer lost")

       quit()

if you_score > dealer_s:

   print("You are the winner", "My score: ",you_score, "\nDealer's score: ", dealer_s)

else:

   print("Sorry, you lost the game", "My score: ",you_score, "\nDealer's score: ", dealer_s)

Explanation:

The python program uses the random module's 'randint' to get a random integer number between 1 and 11, and adds the value to the user's score if the user decides to hit but compares the result with the dealer's if the user stays.

One of the functions of an IDE is to check for: flowchart errors. Syntax errors. memory errors X input and output.​

Answers

Answer:

flowchart errors

Explanation:

Answer:

flowchart errors

Explanation:

Other Questions
neeed hellpp Asap i have 15min left y+1= 6/11(x+4) convert to standard form please WILL GIVE BRAINLIEST 1. Les gants de Stphane sont ____2. Le tee-shirt d'Amina est ____3. La robe de Sandrine est ____4. Le blouson de Stphane est ____5. Le chemisier de Valrie est ____6. La jupe d'Amina est ____7. La calculatrice de Stphane est ___8. Les ballons sont ____ A popular restaurant chain advertises that it delivers orders within 30 minutes. Suppose the average delivery time for one restaurant is 27 minutes with a standard deviation of three minutes. One particular order delivery took 35 minutes. What is the z-score for this delivery time?2.671.671.672.67 needing help asap for anyone that knows!! Energy can be neither created nor destroyed. This fact means that even though energy sources can be depleted (used up), the energy in them is not destroyed. Instead, it is transformed to other forms of energy. And almost all energy resources here on Earth can have their energy traced back to the Suns gravitational or light energy.Electricity is often thought of as a secondary source of energy because it must be gained by transforming some other kind of energy (a primary source). Think about where the electricity generated by a wind turbine comes from. Describe the path that wind energy takes from the Suns light to electricity.plz help ioo pointshurry Which background-repeat value represents this div?repeatrepeat-yrepeat-xno-repeat 1,1,2,3,5,8, ______, ______, _______, _________, _______.What is the filling blanks and Conjecture? 1Which of the following is something Willow is NOT obsessed with?-The number 7-The day, Thursday-Plants-Medical conditions2 How did willows parents keep their highly gifted child engaged and stimulated -they introduced gardening -they scheduled play dates -they read to her from medical textbooks -they enrolled her in special classes 3 How did Mai react to willows quick learning of Vietnamese ?-she thought willow was strange -she was startled -she was impressed -she was indifferent Thank you ASAP I WILL GIVE BRAINLYLISTSTSTSDo you think that cell types with shorter or longer life spans go through mitosis moreoften? Explain your answer. what is the total area of the four walls of a rectangular room 12 ft long by 13 ft wide by 9 ft high? PLESE HURRY!!! 40 POINTS! The following system of linear equations is solved by graphing them on the coordinate plane. y=2x2y=35x+1 Which ordered pair is the best approximation of the solution to the system? (1,0) (1,1) (0,1) (2,1) Select yes or no to indicate whether each of the ordered pairs is most likely a solution to the equation represented by the graph. public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -> System.out.println(name); String name1 = name.toUpperCase(); Runnable r2=() -> System.out.println(name1); r1.run(); } } What is the output of the above program? another brainliest if its right :D Read the following text:The sailboat needed to turn to the right to avoid hitting a log. Jeff turned the steering wheel frantically. Finally, the rudder turned, and the sailboat avoided the log, and Jeff breathed a sigh of relief.What is the meaning of the word rudder as it is used in the sentence? (2 points)A digital tool that is used to measure the depth of waterA large piece of a tree underwater that is a danger to boatsA part of the sailboat that changes direction of the boatA type of life jacket that must be worn in an emergency What is pff mean because Idk At the beginning of the day there were 90 little fish in the pond.At the end of the day there were 52 little fish in the pond.Find the percent decrease from the beginning of the day to the end of the day.Round to the nearest percent. * Los nios (empezar) escuela a las ocho de la maana. options and question below