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
koban [17]
3 years ago
6

def transfer(bank, log_in, userA, userB, amount): ''' In this function, you will try to make a transfer between two user account

s. bank is a dictionary where the key is the username and the value is the user's account balance. log_in is a dictionary where the key is the username and the value is the user's log-in status. amount is the amount to be transferred between user accounts (userA and userB). amount is always positive. What you will do: - Deduct the given amount from userA and add it to userB, which makes a transfer. - You should consider some following cases: - userA must be in the bank and his/her log-in status in log_in must be True. - userB must be in log_in, regardless of log-in status. userB can be absent in the bank. - No user can have a negative amount in their account. He/she must have a positive or zero balance. Return True if a transfer is made. For example:
Computers and Technology
1 answer:
laiz [17]3 years ago
8 0

Answer:

def transfer(bank, log_in, userA, userB, amount): ''' In this function, you will try to make a transfer between two user accounts. bank is a dictionary where the key is the username and the value is the user's account balance. log_in is a dictionary where the key is the username and the value is the user's log-in status. amount is the amount to be transferred between user accounts (userA and userB). amount is always positive. What you will do: - Deduct the given amount from userA and add it to userB, which makes a transfer. - You should consider some following cases: - userA must be in the bank and his/her log-in status in log_in must be True. - userB must be in log_in, regardless of log-in status. userB can be absent in the bank. - No user can have a negative amount in their account. He/she must have a positive or zero balance. Return True if a transfer is made. For example:

Explanation:

i know this much

You might be interested in
Sophisticated modeling software is helping international researchers (1 point) create more intricate screenplays and movie scrip
tatiyna

Answer: Increase the pace of research in finding and producing vaccines.

Explanation: The modelling software is the software that is used by the international researchers for the purpose of the researching about the vaccines. There are diseases which still don't have any vaccines and they create serious health conditions.

So, researchers are investigating and trying to develop the vaccines with increasing pace.Other options are incorrect because researchers are not looking for the movie scripts, marketing products and evidences.

8 0
4 years ago
Def build_dictionary(string):
MissTica

Answer:

Follows are the code to this question:

def build_word_counter(string):#defining a method build_word_counter that accepts string as a parameter  

   d = dict()#defining d variable as a dictionary

   for x in string:#defining for loop that use string

       x = x.lower()#Use lower method  

       if not d.get(x):#defining if block that holds value in d variable

           d[x] = 1#use dictionary to hold value in 1

       else:#defining else block

           d[x] += 1#use dictionary to increment value by 1

   return d#return dictionary

print(build_word_counter(["Like","like","LIKE"]))#use print method to call method

def build_letter_distribution(string):#defining a method build_letter_distribution that accepts string variable

   d = dict()#defining d variable as a dictionary

   for i in string:#defining for loop to count string value

       for j in i:#defining for loop to hold string as number

           if not d.get(j):#defining if block that doesn't get value in dictionary  

               d[j] = 1#hold value in dictionary  

           else:#defining else block

               d[j] += 1#use dictionary to increment the dictionary value

   return d#return dictionary

print(build_letter_distribution(["Like","test","abcdEFG"]))#use print method to return its value

Output:

please find the attached file.

Explanation:

In the first program a method, "build_word_counter" is defined that accepts a string variable in its parameter, and inside the method, a dictionary variable "d" is defined that uses the for loop to hold string value and convert all value into lower case.

In the next step, a conditional statement is used that holds value in the dictionary and count its word value.

In the second program a method, "build_letter_distribution" is defined that holds string variable in its parameter, and inside the method, a dictionary variable "d" is defined that uses the two for loop and in if the block, it holds value in the dictionary and returns its value, and use print method to print its return its value.

4 0
3 years ago
Write Motherboard Components?​
Jet001 [13]

Answer:

These are the parts of a mother board or at least mine for my pc

Hope this helped.

A brainliest is always appreciated.

Explanation:

7 0
3 years ago
Pls help me pass my finals!!​
ale4655 [162]

Answer:

(a): power(2&-2)

The code is as follows:

<em>power = 2**-2</em>

<em>print(power)</em>

<em />

(b): Largest and smallest in a list

The code is as follows:

<em>num = [33,6,11,100,456,109,-4,366]</em>

<em>smallest= min(num)</em>

<em>largest= max(num)</em>

<em>print(smallest)</em>

<em>print(largest)</em>

<em />

(c): Loop in Python

(i) Loop are instructions that are repeated until a certain condition is met;

(ii) For loop, in python are used to iterate over a sequence or through a certain range;

The syntax is:

<em>for loop_element in range(iterating_range):</em>

The following is an illustration of for loop that iterates 5 times

<em>for i in range(5):</em>

Explanation:

(a): power(2&-2)

The ** is used to calculate power.

So, 2**-2 represents 2 raise to power -2

<em>power = 2**-2</em>

This prints the calculated power

<em>print(power)</em>

<em />

(b): Largest and smallest in a list

This initializes the list

<em>num = [33,6,11,100,456,109,-4,366]</em>

This calculates the smallest using min() function

<em>smallest= min(num)</em>

This calculates the largest using max() function

<em>largest= max(num)</em>

This prints the smallest and the largest

<em>print(smallest)</em>

<em>print(largest)</em>

<em />

(c): See answer section

3 0
3 years ago
You copy the formula =SUM($A1:C1) from cell D1 to cell F10. What will the formula change to?
vichka [17]

Answer:

It will change to =SUM($A10:E10)

Explanation:

A1 is the first selection of the series, and because you move the series down ten spaces it changes to A10 instead of A1. C1 changes to E10 because the series is again ten spaces below the original cell and over two columns from C to E, since you moved the formula to F10.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following might be ways to reduce cognitive overload? Select all that apply
    5·1 answer
  • What is the purpose of requirements gathering
    9·2 answers
  • Anyone willing to help with Excel?!!
    15·1 answer
  • Explain the purpose of the frame check sequence (fcs) field in a data link frame trailer.
    7·1 answer
  • When completing an application what color ink do you use
    8·2 answers
  • What is the decrypted binary
    9·1 answer
  • Which format of image files can be inserted in html?​
    8·2 answers
  • List four things that must be taken into consideration when evaluating different resources of information (and explain ANY ONE f
    8·1 answer
  • g Given the information below, answer each part of the question: Page Size: 4 KB a. How many bits are in the Page Offset
    11·1 answer
  • Marcus traded in his 10-year-old truck for a new one. Because it is the first new truck he
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!