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
15. Cinematic tutorials and action-movie camera shots mixed with gameplay and some of the features that have made _____ stand th
Salsk061 [2.6K]
It’s C: The last of us
7 0
3 years ago
According to the text, what have humans used throughout history to overcome physical limits?
Alinara [238K]

Answer:

Cars  

would most likely be your answer. Because technology doesn't help with anything physical. And the other two are horse rubbish.

Explanation:

6 0
4 years ago
How does the post process alert the user if it detects a hardware problem during the post process?
Lesechka [4]
As a Alert down by the bar under where it says start I would think.
6 0
4 years ago
PLEASE HURRY! Match terms in the first column with the order descriptions in column two.
zavuch27 [327]

Megabytes gigabytes terabytes - from smallest to largest

Petabytes terabytes kilobytes - largest to smallest

Exabytes zettabytes megabytes - in no apparent order

Explanation:

5 0
3 years ago
"which programming language is used within html documents to trigger interactive features?"
Rasek [7]
JavaScript can be used to create interactive web pages.
5 0
3 years ago
Other questions:
  • What risks and safeguards are associated with wireless communication? what is “war driving” or “war flying”? are you comfortable
    14·1 answer
  • Which of the following is an acrostic RAM association mnemonic device or Please Excuse My Dear Aunt Sally.
    9·2 answers
  • Ethan is a systems developer. He is working on a system where he will implement independent solutions for different processes. W
    14·1 answer
  • Machinery with rotating or reciprocating parts that are within seven feet of the floor or working platform requires what additio
    7·1 answer
  • EVERYONE PLS JOIN MY GOOGLE CLASSROOM<br> CODE: clmvjbd
    13·2 answers
  • Which tool determines whether or not applications, devices, and computers will work with a new operating system, while maintaini
    13·1 answer
  • Discuss the core technologies and provide examples of where they exist in society. Discuss how the core technologies are part of
    14·1 answer
  • Can someone compress this ipv6 address? 558c:0000:0000:d367:7c8e:1216:0000:66be
    9·1 answer
  • He was called "The father of computing c_______ B_______​
    7·2 answers
  • Which statements are TRUE about web services protocols? (Select TWO responses) SOAP and REST are both web service communication
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!