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
vova2212 [387]
3 years ago
13

A list named parking_tickets has been defined to be the number of parking tickets given out by the city police each day since th

e beginning of the current year. (Thus, the first element of the list contains the number of tickets given on January 1; the last element contains the number of tickets given today.)
Write some code that associates most_tickets with the largest value found in parking_tickets. You may, if you wish, use one additional variable , k.
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
5 0

Answer:

The needed code is highlighted from the current text. The rest of the code is for the simplicity purpose and to show the functionality of the logic that is used to find the most of the tickets sold till date.

Please do go through it

Explanation:

# import the required packages

import datetime

import random

# define the parking_tickets

parking_tickets = []

# set the 1'st day of the year in d1

d1 = datetime.datetime(2016,1,1)

# set the current day

d2 = datetime.datetime.now()

# calculate number of days till date

totalDays = (d2-d1).days

# fill the number of tickets sold each day randomly

# into the parking_tickets till date

for i in range(totalDays):

    randValue = random.randint(1, 100)

    parking_tickets.append(randValue)

# print the list of tickets sold in each day

print("The list of tickets sold over starting from January 1 to till day are: \n",parking_tickets)

# the required actual code

# define a variable to hold the most of the tickets sold

most_tickets = 0

# logic to find the tickets that sold the most

for k in range(len(parking_tickets)):

    # condition to check most_tickets value is lesser than

    # parking_tickets at index k(each day)

    if most_tickets < parking_tickets[k]:

         # if it is less than the parking_tickets at index k

         # then set the value to the most_tickets

         most_tickets = parking_tickets[k]

# print the most tickets sold

print("Most of the tickets that are sold with in date is ", most_tickets)

You might be interested in
Which unknown factor affects prices in the financial markets?
telo118 [61]

Answer:

There are four major factors that cause both long-term trends and short-term fluctuations. These factors are government, international transactions, speculation and expectation and supply and demand.

Explanation:

5 0
3 years ago
If one department chair—a professor—can chair only one department, and one department can have only one department chair. The en
vodka [1.7K]

Answer:

1:1

Explanation:

According to my research on different types of relationships between two variables, I can say that based on the information provided within the question the entities PROFESSOR and DEPARTMENT exhibit a 1:1 relationship. In other words there can only be one Professor per Department and vice-versa.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
17. When an industrial electrical circuit requires a 220 VAC single phase power supply, the electric power supply circuit is nor
Sladkaya [172]

Answer: B

Explanation:

5 0
3 years ago
Which best compares portrait and landscape orientations?
julsineya [31]
#2: Portrait taller than wide & landscape wider than tall
8 0
3 years ago
A small _____ at the lower right corner of a tool indicates that it contains hidden tools​
Vinil7 [7]

Answer:

A small <u><em>TRIANGLE</em></u> at the lower right corner of a tool indicates that it contains hidden tools​

Explanation:

hope it helps you :)

6 0
2 years ago
Other questions:
  • Which one of the following downloads and uploads files to and from a server? A. Client B. Internet protocol C. Server D. Worksta
    9·1 answer
  • Interoperability means
    8·1 answer
  • Monetary Policy can be either Expansionary or Contractionary. Which of the following actions classify as Expansionary Monetary P
    7·2 answers
  • How do you know what memory to purchase for your computer?
    10·1 answer
  • Bitlocker uses the computer's __________ chip to store encryption keys and does not rely on individual user credentials. securit
    10·1 answer
  • Which type of memory helps in reading as well as writing data?
    13·1 answer
  • Which of the following is the Boolean logical operator for AND in C#?
    12·1 answer
  • How to connect xbox one controller
    5·1 answer
  • Explain by details operator overloading in C++ with example
    6·1 answer
  • PLEASE HELP ILL MARK BRAINLIEST!!!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!