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
Unleashes the ability of each person on their team to improve performance, solve problems, and
lisabon 2012 [21]

Answer:

A coach

Explanation:

It fits the question

4 0
3 years ago
Read 2 more answers
Menus are attached to the windows by calling
Lemur [1.5K]

i dont know da answer

4 0
3 years ago
In 1970, the federal government created __________ to both assist and require employers and employees to make the prevention of
Aleksandr-060686 [28]

OSHA

Occupational Safety Health Administration

4 0
3 years ago
(In C prog.) What is the difference between scanf, getche and getchar?
lara [203]
<span>getchar() only reads a single character input from any input stream.
getche() </span><span>reads a single character from the keyboard and displays immediately on output screen without waiting for enter key
scanf() reads the whole input line according to the data type you specified.</span>

7 0
3 years ago
4. An abstract data type is defined as _____.
marusya05 [52]

Answer: object that persist set of values and operations as behavior

Explanation: Abstract data types(ADT)are those object value which are dependent upon the collection of the values and collection of the operations.The organization of the data object is not specified in ADT but the operations that are to be carried out are defined in it.

The implementation individuality displayed by the ADT and hiding of the representation or design makes it abstract.

8 0
3 years ago
Other questions:
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • Never mind I got it
    8·2 answers
  • What are the advantages of upgrading computer hardware?
    13·2 answers
  • This program has some errors in it that are needed to be checked import java.io.*;
    13·1 answer
  • When should recursion be avoided?
    9·1 answer
  • Tara is creating a presentation for her science project about volcanoes. She added different animations to every slide for empha
    12·1 answer
  • Discuss how 3D modeling enhances animation.
    13·1 answer
  • Explain to Alana why she might not want to blast her boss on social media just yet.<br>​
    6·1 answer
  • Sistem komponen mekanikal yang terdapat pada sebuah basikal?​
    13·1 answer
  • The LCD screens are found in​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!