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
guapka [62]
3 years ago
15

Create a variable total of type Double set to 0. Then loop through the dictionary, and add the value of each integer and double

to your variable's value. For each string value, add 1 to the total. For each boolean, add 2 to the total if the boolean is true, or subtract 3 if it's false. Print the value of total.
Computers and Technology
1 answer:
svp [43]3 years ago
6 0

Answer:

total = 0.0

for x in dictionary.values():

   if x == str(x):

       total += 1

   elif x is bool:

       total += 2 if x is True else total -3

   else:

       total += x

print( total )

Explanation:

The python source code defines a variable 'total' and iterates through a dictionary and adds its values to the total variable. Finally, the total value is printed.

You might be interested in
What will be displayed after the following statements execute? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1)
Reika [66]

Answer:

1 1

Explanation:

First we have funny = 7 and serious = 15 .Then after that remainder when serious is divided by 2 is stored in funny that is 1.if condition will be false because funny is equal to 1.else if condition will also be false because it is not 2.So else will be executed and funny =1 and serious =1.

Output=1 1

8 0
4 years ago
Read 2 more answers
Piers lives in an apartment and has an existing home television connection. He wants to subscribe to a high-speed internet conne
lina2011 [118]

Answer:

D. Wireless Network

Explanation:

A Wireless network has no need for cabling, trunking nor any heavy device installation. a Portable wireless device can solve his problem.

5 0
3 years ago
Andy wants to add a script on his website that will automatically update the current date when the script loads in the browser.
FrozenT [24]
The script that Andy would want to use is Javascript, here is the source code: document.getElementById("para1").innerHTML = formatAMPM();
function formatAMPM() {var d = new Date(),    minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),    hours = d.getHours().toString().length == 1 ? '0'+d.getHours() : d.getHours(),    ampm = d.getHours() >= 12 ? 'pm' : 'am',    months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],    days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];return days[d.getDay()]+' '+months[d.getMonth()]+' '+d.getDate()+' '+d.getFullYear()+' '+hours+':'+minutes+ampm;<span>}

The HTML code needed to call this Javascript on his website is this: </span><span><div id="para1"></div>
</span>
You could call the Javascript up using PHP.

Hope this helps! Good luck! :) 
8 0
3 years ago
Write a statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0,adds 1 to the variable parkedD
Elina [12.6K]

Answer:

if speed < 0:

 reverseDrivers +=1

elif speed < 1:

 parkedDrivers +=1

elif speed < 40:

 slowDrivers +=1

elif speed<=65:

 safeDrivers +=1

else:

 speeder +=1

Explanation:

The statements are written in python programming language

See a complete code screenshot attached, where all the variables are defined

8 0
3 years ago
Joe runs a handyman service. He enjoys writing and keeping up on the latest trends. He wants to share this information with his
Bumek [7]
One of the largest things Joe will want to consider is the fact that will his business be spread or just there? For example, if Joe were to use Facebook, he might want to consider the number of users that go to his handyman service. He doesn't want to create a Facebook page if he knows none of his customers have a Facebook page. The reason being that if he were to create a Facebook page, and none of his consumers have it, no one would like the page or share the page. One of the heaviest points is what will appeal to the consumers. 
6 0
3 years ago
Other questions:
  • Why is it important to bring standalone systems into the domain? 4?
    8·1 answer
  • What is one way in which tablets differ from laptops and notebooks
    12·2 answers
  • Networks can be classified by geographical scope as PANs, , and WANs. The cables and signals used to transport data from one net
    9·1 answer
  • Burtex Inc. is an application development organization. Twenty five of its knowledgeable employees are retiring in the upcoming
    6·1 answer
  • Which type of computer network ensures high security
    10·1 answer
  • Ok.,so i have a sopitify account and by accident i pressed the downlaod on button and it says start you free trial i pressed tha
    11·2 answers
  • It is an electronic device that capable of accessing accepting processing product and storing data​
    13·1 answer
  • To read cheques, banks use​
    11·1 answer
  • As part of its commitment to sustainability, a company is looking for a way to track the source of purchased goods and how they
    14·2 answers
  • When a person's personal information is collected by other parties, it refers to the issue of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!