Considering there are 2 dictionaries, one with the name of the person and the stock name and number of stocks they have and the other dictionary has the stock name and it’s today’s market value -

Ex: a = { “Joe” :{“AAPL”:5, “AMZN”:2}, ”Bill” :{“AAPL”:2, “AMZN” :5 }}

B = {“AAPL” : 227, “AMZN” :1721 , “NFLX” : 267 , “TSLA” : 244, “FB” : 179 }



Write a Python program to find the amount of money each person makes by selling all of their stock today, and who will get the most value

Answers

Answer 1

a = {"Joe": {"AAPL": 5, "AMZN": 2}, "Bill": {"AAPL": 2, "AMZN": 5}}

B = {"AAPL": 227, "AMZN": 1721, "NFLX": 267, "TSLA": 244, "FB": 179}

total = 0

largest = 0

for x in a:

   for w in a[x]:

       total += a[x][w] * B[w]

   a[x] = total

   if total > largest:

       largest = total

   print("{} will have ${}".format(x, total))

for x in a:

   if a[x] == largest:

       print("{} will get the most value".format(x))

I hope this helps!


Related Questions

I don't understand how to do these. It's python by the way.

Answers

Answer:

Disclaimer: I dont put the Euler, magic word, and another variables, you need to do this

Explanation:

print(eulersNumber[16])

print(eulersNumber[26])

print(eulersNumber[31])

print(magicWords[:3]+magicWords[8:10])

3° I dont know how i can make this

print(a[::-1])

print(b[::-1])

print(c[::-1])

print(x[::-1])

print(y[::-1])

Have a nice day

What are elements ?Give any five example​

Answers


Chemical element, also called element, any substance that cannot be decomposed into simpler substances by ordinary chemical processes. Some examples are carbon, oxygen, hydrogen, gold, silver and iron.

Technical environment refers to all the technological surroundings that influence organization. Technology consists of skills,methods,systems and equipment. It includes and innovations. It makes work more efficient. It is a means to transfer input into outputs.

Technology influences organizations by bringing about changes in jobs, skills, lifestyles, production methods and processes. Automation, computerization, robotics, informatics, biotechnology, laser, new materials and artificial intelligence have all influenced organizations.Information technology affects every function of within the organization.Organizations should be aware of technological changes tot avoid obsolescence and promote innovation.

Technological forecasting is also important.Technology reaches people through organization. It is a powerful force that shapes their destiny.

1)Level of technology: The level of technology can be appropriate or sophisticated. It can be labour-based or capital-based.The level of technology influence organizations.

Labour based technology: Human labour is mainly used for operations.

Capital based technology: Machinery is mainly used for operations. Technology is represented by automation, computerization, robotizing, etc.

2)Pace of technological change: Technology is a dynamic force. Its speed of change is accelerating. Invention, innovation and diffusion increase its pace. Organizations should adapt to changing technological forces. They should also upgrade the skills of their human resources to effectively cope with the demands of technological changes.

Technological change influences organizations in the following :

It can make existing industries obsolete.It can the rates of obsolescence.

It can rejuvenate the existing industries through product improvements or cost reductions.

It can create entirely new industries.

It can increase government regulations.

3)Technological transfer: Sources of technology can be within the organization, within the country or foreign countries. Technology transfer implies technology import for organizations.

Technological transfer implies technology imported from technologically advanced foreign countries. Its speed is important for organizations.

Globalization: Global companies are the key sources of technology transfer in developing nations.

Projects: Turnkey projects based on global bidding serve as a source of technology transfer.

Trade: This consists of the sale of equipment or machines by the manufacturer.

Technical assistance: Bilateral and multilateral donors under technical assistance provide international consultants who bring new technology with them.

Training and publication: They provide opportunities to about new technology.

Technological transfer influences organization by :

Increasing and decreasing costs.

New product development and product improvement.

Improving production systems and processes.

Better satisfaction of customer needs.

4)Research and development: R&D is the essence of innovation. The Expectation for improvement is increasing. Customers expect new products of superior quality which are safe, comfortable and environment friendly. This calls for increase research and development budget by organizations. Government and industry collaboration and spending in R&d efforts is also an important aspect of the technology environment.

I hope this helped!

which of these options highlights the need for learning algorithms
A. Algorithms help you draw neat diagrams
B. Algorithms help you create easily understandable programs
C. Algorithms help you learn assembly-level language
D. Programmers can code using algorithms only

Answers

Answer: D.

Explanation:

Answer:

The answer is B. Algorithms help you create easily understandable programs

Explanation:

I got it right

What is application software used for?

Answers

Answer:

Explanation: Application software is a type of computer program that performs a specific personal, educational, and business function. Each program is designed to assist the user with a particular process, which may be related to productivity, creativity, and/or communication.

Answer:

to make certain tasks easier for the computer user

Explanation: a p e x

write a python program to print the following series 3..10..31..94......n​

Pls answer fast..

Answers

I've included my code in the picture below. Best of luck

Social networking is the most popular online activity?
True
False

Answers

Answer:

true

Explanation:

It’s true because I said so

For this assignment, you will create a calendar program that allows the user
to enter a day, month, and year in three separate variables as shown below.
Day:
Month:
Year:
Then, your program should ask the user to select from a menu of choices
using this formatting
Menu:
1) Calculate the number of days in the given month.
2) calculate the number of days left in the given year.

I would really appreciate it if someone could help me on this.

Answers

Following are the program to the given question:

Program Explanation:

Defining three methods "leap_year, number_of_days, and days_left " is declared. In the "leap_year" method, it accepts the year variable, which calculates the year is the leap year and returns its value that is 1. In the next method "number_of_days", it is define which accepts the "year and month" variable in the parameter and calculate and returns its value. In the last "days_left" method, it calculates the left days and returns its value, and outside the method, two dictionary variable days_31 and days_30 is declared.  It initilized a value by using 3 input variable "day, month, and year" variable which accepts user-input value. In the next step, a "c" variable is declared, that input values and calls and print its value accordingly.

Program:

def leap_year(y):#defining a method leap_year that takes one parameter

   l= 0#defining l variable that holds an integer

   if y % 4 == 0:#using if block that check year value module by 4 equal to 0

       l = 1#holding value in l variable

   if y % 100 == 0:#using if block that check year value module by 100 equal to 0

       l = 0#holding value in l variable

       if y % 400 == 0:#using if block that check year value module by 400 equal to 0

           l= 1#holding value in l variable

   return l#return l value

def number_of_days(m, y):#defining a method number_of_days that takes two parameters

   months = {1: 31, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}#defining months variable that hold value in ictionary

   l = leap_year(y)#defining l variable that calls leap_year method and holds its value

   if l == 1 and m == 2:#use if that check l value equal to 1 and 2

       return 29#return value 29

   if m == 2:#use if that check month value equal to 2

       return 28#return value 29

   return months[m]#return months value

def days_left(d, m, y):#defining a method days_left that takes three variable in parameter

   l = leap_year(y)#defining l variable that hold leap_year method value

   days = 0#defining days variable that hold integer value

   months = {1: 31, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}#defining months variable that hold value in ictionary

   if l== 1:#using if that check l equal to 1

       if m > 2:#defining if that check m value greater than 2

           days += (29 + 31)#using days variable that Calculate holds its value

           i = m#defining i variable that holds months value

           while i > 2:#defining while loop that checks other days

               days += months[i]#defining a days variable that holds months value

               i -= 1#decreasing i value

           days -= (months[m] - d)#defining days that subtracts leap value

       elif m == 2:#defining elif block that checks m equal to 2

           days += (29 - d) + 31#holding value in days variable

       else:#defining else block

           days = 31 - d#Calculating days value

       return 366 - days#using return keyword that Calculates days value

   else:#defining else block

       if m > 2:#using if that checks m value greater than 2

           days += (28 + 31)#Calculating and store value in days

           i = m#holding months value in i

           while i > 2:#defining while loop that checks i value greater than 2

               days += months[i]#holding list value in days

               i -= 1#decreasing i value

           days -= (months[m] - d)#defining days that subtracts leap value

       elif m == 2:#using elif block that checks m value equal to 2

           days += (28 - d) + 31#Calculating and store value in days

       else:#defining else block

           days = 31 - d##Calculating and store value in days

       return 365 - days#return total days

print("Please enter a date")#print message

day = int(input("Day: "))#input value

month = int(input("Month: "))#input value

year = int(input("Year: "))#input value

print("Menu: ")#print message

print("1) Calculate the number of days in the given month.")#print message

print("2) Calculate the number of days left in the given year.")#print message

c = int(input())#input value

if c == 1:#using if that checks c value equal to 1

   print(number_of_days(month, year))#calling method and print its return value

elif c == 2:#using if that checks c value equal to 2

   print(days_left(day, month, year))#calling method and print its return value

Output:

Please find the attached file.

Learn more:

brainly.com/question/16728668

Where do high tides occur? (Select two.)
WILL GIVE BRANLEST PLS ASAP

only at the South Pole

on the side of Earth opposite the moon

on the side of the Earth facing the moon

only at the North Pole

at both the North and South Poles

Answers

Answer: The Moon's gravitational pull generates something called the tidal force. The tidal force causes Earth—and its water—to bulge out on the side closest to the Moon and the side farthest from the Moon. These bulges of water are high tides. High tide (left) and low tide (right) in the Bay of Fundy in Canada.

Explanation:

So the two I think will be 1. On the side of the earth facing the moon and I think both south and North Pole

mention some of the codes of conduct of Information Technology (IT)​

Answers

Answer:

Below! ;)

Explanation:

Computer Science:

Binary

Morse code

Computer Programming:

Java

Python

etc.

Hope this helps!

Have a nice day!

If you find my answer helpful

Pls consider marking my asnwer as Brainliest! It would mean a lot!

A friend a just opened his own barber shop and has asked you to develop a program to track the type of service the customer is receiving and the cost for the service and also include any tips the customer may give to the barber. The name of your friend's barber shop is Big Al's and on each customer receipt he wants to display the name of his shop, customer name, the type of service, cost of the service, and the amount of the tip for a total price of the service rendered. Name your variables Declare your variables

Answers

Answer:

class Barber(object):

   barber_shop = "Big AI's barber shop"

   def __init__(self, customer_name, type_of_service=[], tip=0):

       self.cust_name = customer_name

       self.tos = type_of_service

       self.tip = tip

   def service_type(self, *args):

       for i in args:

           self.tos.append(i)

   def total(self):

       

       services = {'trimming':10, 'hair_cut':20, 'shaving':15, 'washing':5, 'dyeing':5}

       contain = ''

       total = 0

       for service in self.tos:

           if service in services.keys():

               total += services[service]

               contain += f'{service}: {services[service]}\n'

       

       print(self.barber_shop,'\n', self.cust_name,'\n', 'Services:',contain.splitlines(),'\n', \

           f'total: ${total}', '\n',f'Tip: ${self.tip}')

mycust = Barber('John',['washing'],6 )

mycust.service_type('shaving', 'dyeing')

mycust.total()

Explanation:

The Barber class is a blueprint used to create an object instance of customers that visits the barber-shop. It has two methods 'service_type' and 'total' which are just defined functions of the class that appends services to the type of service variable and total that prints the total cost of services on the screen.

What is another name for a numbered list

Answers

Answer:

Another name for a numbered list is a list

_____moves the head to proper track

a.
Seek
b.
Data transfer
c.
Rotate
d.
Settle

Answers

to what it seems like the answer would be C
i believe the answer is C

Which Python expression results in 49?

7 * 2

7^2

7 // 2

7 ** 2

Answers

Answer:

7^2

Explanation:

7^2 is the same as 7*7

Answer:

7^2 ( ^ ) this sign help us

What is the purpose of the introduction in an expository essay? A. to introduce the author and his or her dedication B. to highlight the main points of the essay C. to describe the supporting details D. to provide a figurative interpretation of the essay

Answers

I think it’s B, sorry if I’m wrong with this >

Which MLA web source citations are formatted correctly? Check all that apply.
Wolfson, Elijah. “Newsweek Names a Mars Crater.” Newsweek. Newsweek, 28 Feb. 2014. Web. 1 Mar. 2014.
Herman, Barbara. “Where’s the Fire?” Newsweek. Newsweek, 24 Oct. 2013. Web. 25 Feb. 2014.
Niesen, Joan. “Learning to Cope: Disabled Vet Hunt Finds Freedom as Paralympic Skier.” Sports Illustrated. Web. 27 Feb. 2014.
A Mighty Girl. N.p., n.d. Web. 26 Feb. 2014.
Kloc, Joe. “Kepler Mission Finds Hundreds More Planets.” 2 Feb. 2014. Web. 25 Feb. 2014.

Answers

Answer:

Explanation:

A,B on exp.

The correct MLA web source citations are:

Wolfson, Elijah. “Newsweek Names a Mars Crater.” Newsweek. Newsweek, 28 Feb. 2014. Web. 1 Mar. 2014.

Others are:

Herman, Barbara. “Where’s the Fire?” Newsweek. Newsweek, 24 Oct. 2013. Web. 25 Feb. 2014.

What is MLA citation?

MLA in-text citation style is known to be a citation method that is often used in citing authors. Her one often uses the author's last name and the page number from where the work is taken from.

A good example of this  MLA web source citations is:

Wolfson, Elijah. “Newsweek Names a Mars Crater.” Newsweek. Newsweek, 28 Feb. 2014. Web. 1 Mar. 2014.

Learn more about MLA web source  from

https://brainly.com/question/26110488

#SPJ2

What can you add to your presentation from the Insert tab?

Animations
Pictures
Variants
Transitions

Answers

Answer:

B. PICTURES

Explanation:

Answer:

I know its late but pictures is the answer.

Explanation:

I took the test and got it right.

Amy is not sure if the Web page loaded completely in her browser. She should look at the _____.

status bar
command toolbar
search engine
address bar

Answers

Answer:

Status Bar

Explanation:

A status bar will show the progress of the page that is being loaded.

Status bar It shows how much the page has loaded and how much it has left till fully loade

which option is the correct format of placing html tags while coding in html
A.
B.
C.
D.

Answers

Answer:

what are the answers?

it just says A, B. C. or D.

Explanation:

what makes classical music "classical"?​

Answers

Answer:

Whereas most popular styles are usually written in song form, classical music is noted for its development of highly sophisticated instrumental musical forms, like the concerto, symphony, and sonata. Classical music is also noted for its use of sophisticated vocal/instrumental forms, such as opera.

Answer:

the time period in which it was composed

Explanation:

Create a class called Drive. It should have instance fields miles and gas which are both integers. Another instance field, carType, is a String. The constructor should receive a String which initializes carType. The other two instance fields are both automatically initialized to 1 in the constructor. Create a method called getGas that returns an integer that is the gas data member. The getGas method has no parameters. Write in java. First correct answer will be marked brainliest, i need answer very soon

Answers

public class JavaApplication87 {

   

   public static void main(String[] args) {

       Drive dr = new Drive("Insert type of car");

       System.out.println(dr.carType);

   }

   

}

class Drive{

   int miles;

   int gas;

   String carType;

   public Drive(String ct){

       carType = ct;

       miles = 1;

       gas = 1;

       

   }

   int getGas(){

       return gas;

   }

   

}

I'm pretty sure this is what you're looking for. Best of luck.

how to beat level 50 in give up robot 2

Answers

Answer:

just follow the steps and and become tough calm but tough

3. You'd prefer to read this email on a larger screen, so you open your laptop. Your laptop display is quite flat. What kind of screen do you think it is?

Answers

Answer:

.....

Explanation:

Answer:

plasma Screens

Explanation:

Used for very large screens and some laptops which display ones screen Flat.

What is the advantage of using the Publish Online option for sharing a calendar? It creates a web version that can be viewed by anyone. It allows an employee's boss to see busy/free information. It allows a user inside an organization to view the calendar. It allows a user outside an organization to view the calendar.

Answers

Answer:

its D. it allows a user outside an organization to view the calendar.

Explanation:

i just got it right on edge 2020.

Answer:

B

Explanation:

Its made up of a small memory chips on a card that can hold data in an electronic format​

Answers

The chip can allow you to have more data and more pictures so your phone does not become slow and messages and apps and more.

[Files, for loops, exceptions; 20pt] Using a for loop, write a function called countWord(). It takes 2 parameters: The name of a text file (e.g. gettysburg.txt that is included with this test) and a word to be searched within that file. Your code should return the number of times the given word appears in the file. Capitalization should not matter. Make certain to handle file exceptions gracefully.

Answers

def countWord(name, word):

   try:

       f = open(name, "r")

       lst = ([])

       w = ""

       for x in f.readlines():

           w += x.lower()

       lst = w.split()

       f.close()

       return lst.count(word)

   except FileNotFoundError:

       print("Please create a file or use the name of an existing text file.")

print("Your word appears", countWord("gettysburg.txt", "random"), "time(s)")

The text file I used for testing looks like:

random words

random words

I'm putting random words in here

random

this is random

RaNdOm

I didn't really know what exceptions your professor is looking for so I just used the file not found one. Best of luck.

What will be displayed in the console when the following program runs?

var count = 0
while (count != 5){
console.log(count);
count = count + 2;
}

Answers

Answer:

The integer, count, will be stuck in a infinite while loop, and the console will keep adding 2 to count, so it'll look something like this.

0

2

4

6

8

10

12

14

and so forth...

Explanation:

The while loop will never stop because count can not equal to 5 because you can't add 2 to another multiple of 2 to get 5.

Because count cannot reach 5, and you cannot add 2 to another multiple of 2, the while loop will never come to an end.

What displayed in the console when program runs?

An endless loop is a section of code that never reaches the ending condition, hence it keeps running indefinitely. An infinite loop may cause your software or browser to crash or freeze. Infinite loops must be understood in order to avoid such situations.

When a condition always evaluates to true, an infinite loop happens. Typically, this is a mistake. You may, for instance, have a loop that decreases until it hits zero.

Therefore, It will resemble this because the integer count will be locked in an unending while loop and the console will keep adding 2 to count. 0, 2,4, 6, 8, 10,12, 14 The program will end in an infinite loop.

Learn more about program runs here:

https://brainly.com/question/19339163

#SPJ2

What two states do binary numbers represent?

A) Coder and processor
B) Input and output
C) On and off
D) Right and left

Answers

Answer:

C

Explanation:

Binary is a base-2 number system that uses two mutually exclusive states to represent information. A binary number is made up of elements called bits where each bit can be in one of the two possible states. Generally, we represent them with the numerals 1 and 0.

Answer:

C

Explanation:

On and off symbolize 0 and 1.

Question # 3
Fill in the Blank
What is the output?
answer = "Hi mom"
print(answer.lower())

Answers

what not understanding

the output is mom, hope this helped p

Select the correct answer.
Bella is moving the camera physically to the left to capture a fast-paced shot. Which technique is she using?
OA
pan left
OB.
truck left
O c.
truck right
OD.
zoom left
OE.
pan right

Answers

A ?
Because Bella is physicals moving the camera so I think it is A

__ allow(s) users with mobility issues to control the computer with their voice.

Speech input software

Tracking devices

Head pointers

Text-to-speech

Answers

Answer:

Speech input device

Explanation:

I think this is the answer

Answer: speech input software

Explanation: got it right on edgen

Other Questions
PLEASE HELP ME!! Usa-testprep!! Select the correct answer.Which rhetorical device is used in this excerpt from "The Danger of Lying in Bed" by Mark Twain?"If I am going to travel by rail I shan't need it. Lying at home in bed is the thing I am afraid of."A. allusionB. imageryC. ironyD. anecdote An 8-foot piece of twine costs $5.76. What is the price per inch? A members-only speaker series allows people to join for $28 and then pay $4 for every event attended. What is the total cost for someone to attend 4 events? Write and solve an equation to find the answer 19. Find 3 consecutive integers such that twicethe least integer is 12 more than the greatestinteger. PLEASSEEEE HELP ASAAPPPPPPP 22. Which of the following are benefits of OPEC?*Check ALL that are TRUE.keeps oil prices lowreduces competition between oil-producing countriesallows oil-producing countries to make more moneyallows oil sources to be used up faster Which visual aid would be best for comparing the percentages of college students in different fields of study this year?a tablea Venn diagrama web diagrama pie graph Kyle has 2 3/4 pounds of flour. He wants to divide the flour into 3 equal-sizedbags. How many pounds of flour are in each bag? Please help me I will give you brainleist if I figure out how Given the function, d(t) = 50t, the variable t represents which of the following?Select all that apply.outputindependent variablefunctioninputdependend variable The points (80, 20) and (120, 30) form a proportional relationship. What is the slope of the line that passes through these points? please help me pleasee i need help please In HxH Leorio's friend died from a virus. Why did Leorio want to become a doctor to save his friend if he was already dead? During stage 2 sleep, most of the brain waves will be measured as __________ waves.A.betaB.alphaC.thetaD.deltaEDGE 2020! ((: thank you! Elena and Jada are 24.5 miles apart on a path when they start moving toward each other. Elena bikes at a constant speed of 8 miles per hour, and Jada runs at a constant speed of 6 miles per hour. How long does it take until Elena and Jada meet? Explain your reasoning. Match the definition to the correct homonym | IWILL GIVE BRAINLIEST TO WHOEVER ANSWERS FIRST AND CORRECTLY1. a large, paved passageway for vehicles sow 2. past tense of ride sew 3. past tense of row, which is moving a boat using oars I'll 4. to make a garment using a needle and thread their 5. to toss seeds in the ground so that crops will grow so 6. also; too scent 7. smell; aroma rode 8. the past tense of send they're 9. a monetary unit; the smallest American monetary unit sent 10. toward a particular place isle 11. the possessive of they cent 12. contraction of they are there 13. a passage through which one may walk rowed 14. a small land mass that is surrounded on all sides by water; island aisle 15. contraction of I will road Balance chemical equation hbr(aq)+o2(g) h20(l)+br2(l) Activity 1Refer to Source A1.1. Explain why dotted Bnes have been drawn to show the areas occupied by different groups (2)1.2. Does the map resemble, in any way, the map of Africa you know today? Explain youranswer)Refer to Source B2.1. Which event does this cartoon represent?22. Who are the men in the cartoon?(1)23 Eplain what the men in the cartoon are doing and what it represents2)24. How does the cartoonist feel about the event depicted in this cartoon? Justify your answer. (2)25. Who has not been represented in this cartoon? Explain why.2)Refer to Source C3.1. Which two countries had the most territory?3.2. Suggest a reason for your answer to question 3.1.3.3. Compare this map of Africa to the one you know today.4. Refer to Source D.4.1. Explain why the journalist describes the Berlin Conference as a "robbery!42. Why do you think the journalist believes it is the greatest robbery the world has ever(2)known?(2)43. Suggest a reason why Africans were "powerless to preventTotal: 25aeeaaa saa 8 saaCAUSES OF COLONISATIONThere were many reasons for the colonisation of Africathat they would be ple to make Type the following fractions in order from greatest to least:5/4, 4/10, 5/12, , 11/12 Write the decimals in the boxes from greatest to least:0.5, 0.91, 0.04, 0.89, 0.51