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
In ipv4 addressing, each ip address is a unique ____ number.
Natali5045456 [20]
32-bit is the correct answer to this question.
4 0
3 years ago
How many lines of codes did the windows 98 operating system contain
stellarik [79]
<span>The Windows 98 operating system contains approximately 13 million lines of code.</span>
8 0
3 years ago
Read 2 more answers
Can you think of other businesses that might benefit from using voice response this system?​
sergey [27]

Answer:

call centers benfit big in this field

Explanation:

5 0
3 years ago
Write a C program that stores N random numbers in an array named rA[ ] and determine the largest, smallest, and average values o
Aliun [14]

Answer:

// program in C.

// headers

#include <stdio.h>

// headers

#include <stdlib.h>

// headers

#include <limits.h>

// main function

int main(int argc, char** argv)

{

   // read value of N from command line arguments

   int N=atoi(argv[1]);

   // variables

   int max=INT_MIN;

   // variable

   int min=INT_MAX;

int rA[N],i;

// fill the array with random number

for(i=0;i<N;i++)

{

    // generate random number from -50 to +50

    rA[i]=rand()%101-50;

    // find the Maximum

    if(rA[i]>max)

    max=rA[i];

    // find the Minimum

    if(rA[i]<min)

    min=rA[i];

}

// print values of array

printf("values of the array are:");

for(i=0;i<N;i++)

{

    printf("%d ",rA[i]);

}

// print Maximum

printf("\nMaximum value is:%d",max);

// print Minimum

printf("\nMinimum value is:%d",min);

return 0;

}

Explanation:

Read value of N from command line.Then create an array of size N.Fill the array with random number from -50 to +50.Then find the Maximum of all the elements and  assign it to variable "max" and find Minimum from all and assign it to variable "min". then print all the elements of the array, Minimum and Maximum.

Output:

command line argument=10

values of the array are:-18 -18 4 -38 2 6 -42 -20 -6 44 -6 -11 15 -31 1                                                    

Maximum value is:44                                                                                                        

Minimum value is:-42

4 0
3 years ago
LOLer was chatting online with l33ter. "I can't believe how lame some people are! :) I can get into any system by checking out t
Mkey [24]

Answer:

The answers are <em>"</em><em>hacker </em><em>and </em><em>hacking</em><em>"</em>

Explanation:

LOLer is an security hacker who uses computer bugs and other exploits to break into a company or personal network system by using their personal ingenuity and other accesses. Thus the process he described of getting into the company server details and getting peoples IP addresses and details on the company involves security hacking of the company network.

5 0
3 years ago
Other questions:
  • Using the expected format, of putting key information where the reader can’t find it, is an example of?
    8·2 answers
  • A method variable a class variable with the same name. a) acquiesces to b) destroys c) overrides d) alters
    14·1 answer
  • A custom information field that helps users to find a specific document is called
    8·2 answers
  • Why are 90% of questions not being answered im scrolling through the questions. Most are not being answered except the easy ques
    8·2 answers
  • Int a=10 int b=20<br> A=b<br> The new values for a and b are
    11·2 answers
  • Compressing a file is also called
    9·2 answers
  • The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:
    9·1 answer
  • What responds to both visual appeal and functional needs? (1 point) A.) applied art B.) performance art C.) fine art D.) visual
    14·1 answer
  • Hello everyone! can anybody help me? i need help with computing.
    10·1 answer
  • r packages include sample datasets. they also include reusable r functions and documentation about how to use the functions. Tru
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!