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
You are the senior nurse on the unit and you are orienting a new graduate LVN/LPN. One of the subjects you want to cover today i
Margarita [4]

Answer: D. Homans sign

Explanation:

Check for the severity of the swelling, monitor the flow of blood to the tissue, pulses equality, check for homans sign such as pain in the leg around the calve, the calve is meant to be of equal size and warmth. There should not be any reddish colouration or pains around the calve when there is ankle movement as this shows a negative sign of homans.

3 0
3 years ago
which shortcut can we use to make directional heading of a cuboid more obvious while in the lidar view​
Lady bird [3.3K]

Answer:

cutting across

Explanation:

4 0
3 years ago
To make your brand colors stand out, it is important to implement what with your color scheme?
qaws [65]

Answer:

All of the above

Explanation:

It's better to have a pattern of colors than one single color in you color scheme.

6 0
3 years ago
Read 2 more answers
two examples of processes for data collection. What key principles are considered in these processes to ensure data accuracy?
aliya0001 [1]

Answer:

Two examples of processes for data collection are:

In-person interviewing: This is a face-to-face method or process of data collection. It has a high rate of response and allows you to ask follow-up questions when the response of the interviewee is not clear.

Sample Surveys: In this method, a sample is selected from a large population and then a questionnaire is constructed and sent to the sample for them to give their feedback or response in line with the research problem.

Three Key Principles considered in these processes to ensure data accuracy are:

Completeness: This means that what was expected to be collected as data was what was collected. Completeness of data is a vital factor for data quality.

Consistency: There must be uniformity in the data collection process. Everyone involved in the data collection process must understand what is required of them.

Accuracy: The data must be free of errors

Explanation:

7 0
3 years ago
Ports 1-1023 are known as
Anestetic [448]
Hello, they are better known as TCP and UDP ports. These are protocols needed for internet data communications.

Have a nice day :)
5 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose a computer has 16-bit instructions. The instruction set consists of 32 different operations. All instructions have an op
    6·1 answer
  • What are the Database used in RDBMS and DBMS<br>please answer immediately​
    10·1 answer
  • When you access the programs and documents on a computer by what way of icons is said to be employing
    6·1 answer
  • Create a java class for Bank Accounts with these public String attributes: ownerName, acctNbr and these private double attribute
    11·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • You just bought a hard drive, you plan on using this a secondary storage, once installed, what needs to be done to the drive and
    6·1 answer
  • If you type =5*3 into a cell, what do you expect the answer will be?
    11·2 answers
  • Which of the following is NOT a file format used for word processing documents? A. .ppt B. .rtf C. .doc D. .odt
    5·1 answer
  • How many digits are in the binary number system? Explain why.
    11·2 answers
  • True or false with reason :- profit and loss account is a real account​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!