Computer Science, asked by kangym727, 9 months ago

python users! help! (it actually just the quesion i just ask, but this is what i mean.) if you input a year, a month and a day, it will know how many days (the days and month you inputed) there is already passed from the year you inputed.

Answers

Answered by sanagulnazmominaiman
0

Answer:

In this chapter, you will learn how to make the computer execute a group of statements over and over as long as certain criterion holds. The group of statements being executed repeatedly is called a loop. There are two loop statements in Python: for and while. We will discuss the difference between these statements later in the chapter, but first let us look at an example of a loop in the real world.

A petrol attendant performs the following actions when serving a customer:

greet customerask for required type of petrol and amountask whether customer needs other servicesask for required amount of moneygive money to cashierwait for change and receiptgive change and receipt to customersay thank you and goodbye

A petrol attendant performs these steps for each customer, but he does not follow them when there is no customer to serve. He also only performs them when it is his shift. If we were to write a computer program to simulate this behaviour, it would not be enough just to provide the steps and ask the computer to repeat them over and over. We would also need to tell it when to stop executing them.

There are two major kinds of programming loops: counting loops and event-controlled loops.

Similar questions