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
natta225 [31]
3 years ago
9

Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_di

ct') as key-value pair. The program then asks if the user wants to enter more data (More data (y/n)? ) and depending on user choice, either asks for another name-number pair or exits and stores the dictionary key, values in a list of tuples and prints the list. Note: Ignore the case where the name is already in the dictionary. Example: Name: pranshu Number: 517-244-2426 More data (y/n)? y Name: rich
Computers and Technology
1 answer:
AleksAgata [21]3 years ago
6 0

Answer:

#Declare the variables.

the_dict = {}

dictlist = []

#Begin the while loop.

while True:

   #Prompt the user to enter the name

   #and the number.

   input_name = input("Name: ")

   input_number = input("Number: ")

   

   #Ask the user to continue or stop

   #the program.

   input_choice = input('More data (y/n)? ')

   the_dict[input_name] = input_number

   

   #Check the input.

   if input_choice == 'n':

       break

#If the user want to continue

#then append in the list.

for key, value in the_dict.items():

   

   #Store the values in dictionary.

   temp_val = (key,value)

   dictlist.append(temp_val)

   

#Sort the list.

print(sorted(dictlist))

You might be interested in
2- There are many different design parameters that are important to a cache’s overall performance. Below are listed parameters f
katen-ka-za [31]

Answer:

1. 2588672 bits

2. 4308992 bits

3. The larger the data size of the cache, the larger the area of ​​memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.

Explanation:

1. Number of bits in the first cache

Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))

total bits = 2^15 (1+14+(32*2^1)) = 2588672 bits

2. Number of bits in the Cache with 16 word blocks

Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))

total bits = 2^13(1 +13+(32*2^4)) = 4308992 bits

3. Caches are used to help achieve good performance with slow main memories. However, due to architectural limitations of cache, larger data size of cache are not as effective than the smaller data size. A larger cache will have a lower miss rate and a higher delay. The larger the data size of the cache, the larger the area of ​​memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.

5 0
2 years ago
To instruct Oracle11 g to sort data in ascending order, enter ____ after the column name in the ORDER BY clause.
Paha777 [63]

Answer:

A. ASC

Explanation:

In Oracle11 g ORDER BY clause is used to sort data andit is also used in mysql ,ms access.Though we not to mention ASC to sort in increasing order because by default it sorts the data in ascending order if we do not mention ASC or DESC.To sort in descending order we have to mention DESC.

So the correct answer to this question is ASC.

7 0
3 years ago
Read 2 more answers
When subjects are given two drinks but not told what they are drinking in order to get accurate results on which is the better t
Aneli [31]

Answer:

Blind.

Explanation:

In a blind experiment, information that can affect the participant's decision after the experiment is not told or we can say blinded until the experiment is over. Good blinding can eliminate experimental biases . A blind can be imposed on any participant.So in the question we conclude that it is blind experimental design.

7 0
3 years ago
What is the best resource to learn python?
7nadin3 [17]

Answer:

prolly a snake expert

Explanation:

they know snakes

4 0
2 years ago
Read 2 more answers
1. What does it mean to say that a country’s land area is positively correlated with its population?
disa [49]
For 1.
Positive correlation means if you plot a country's population and land size on a graph. There would be a linear regression line that's sloping upwards. 

Since it's a scatterplot, there will be some that fall out of the line, but most of them should be on the line.

It's  (A)

For 2.
An outlier is a datapoint that's far, FAR away from the others, so it's (B)

For 3. (A), it's a single line-of-best fit that runs through the middle of the cluster of data points.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Write a memo to the vice president, outlining the steps an employee might have taken to create an e-mail message and make it app
    15·1 answer
  • What inventor patented the first American movie projector?
    14·2 answers
  • Numeric data is stored in ___________ for direct processing.
    6·2 answers
  • While surfing online, Patricia checks her email and reads the latest messages. She then browsers a website and logs in a comment
    8·1 answer
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • Enna always says thank you when people give her gifts. She even writes thank-you cards. On holidays, Enna remembers
    9·1 answer
  • Can somebody help me out
    15·1 answer
  • ساعدوني على الإجابة على هذه الأسئلة
    11·1 answer
  • Microsoft vs Sony who wins ​
    13·2 answers
  • While conducting routine maintenance, you discover a network server that needs to
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!