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_dict') 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 Number: 517-842-5425 More data (y/n)? y Name: alireza Number: 517-432-5224 More data (y/n)? n [('alireza', '517-432-5224'), ('pranshu', '517-244-2426'), ('rich', '517-842-5425')]

Answers

Answer 1

Answer:

Okay. I am doing it with Python. Hope it'll help you to understand the concept.

Code:

the_dict={}   #Creating a dictonary

def dat():    # Creating a function named dat()

   

   name = input('Your Name: ')   # Data from user

   ph = input('Phone Number: ')

   for i in range(1):  #Creating loop

       the_dict[name]=ph   # Placing the value in dictonary

   more = input('More Data (y/n): ')   # Asking for More data

   if more == 'y':   # if more is y then run the function dat()

       dat()   # calling dat()

   elif more == 'n':   # if more is n then print the dictonary named 'the_dict'

       print(the_dict)

   else:

       print('Wrong Input')  # if wrong input print the message and run dat() again

       dat()

dat()  # calling the function

   

Result:

Your Name: PyMan

Phone Number: 9814579063

More Data (y/n): y

Your Name: PyMman2

Phone Number: 451513262026

More Data (y/n): y

Your Name: C#Man

Phone Number: 7798822222

More Data (y/n): n

{'PyMan': '9814579063', 'PyMman2': '451513262026', 'C#Man': '7798822222'}

Answer 2

Below is the required Python code.

Python

Program:

#Creating a dictionary

the_dict={}  

#Creating a function

def dat():    

   

  #Input data

  name = input('Your Name: ')  

  ph = input('Phone Number: ')

  #Creating a loop

  for i in range(1):  

      #Placing the value in dictionary

      the_dict[name]=ph  

  #Asking the user for more data  

  more = input('More Data (y/n): ')  

  #Run the function, of more is "y"

  if more == 'y':

     

      #Calling the function dat()

      dat()  

  #Print the dictionary named "the_dict", if more is "n"

  elif more == 'n':  

      print(the_dict)

  else:

      #Print the message and run the function, if wrong

      print('Wrong Input')  

      dat()

#Function calling

dat()  

Program explanation:

Creating a dictionary and function.Input data.Creating a loop.Placing the value in dictionary.Asking the user for more data.Run the function, of more is "y".Calling the function.Print the dictionary named "the_dict", if more is "n".Print the message and run the function, if wrong  

Output:

Find below the attachment of program output.

Find out more information about Python here:

https://brainly.com/question/26497128

Write A Program That Asks For 'name' From The User And Then Asks For A Number And Stores The Two In A

Related Questions

Logically twisted pair Ethernet employs a bus topology, but physically twisted star-shaped topology True/False

Answers

Answer:false

Explanation:

The thick net medium consisted of a thin coaxial cable True/False

Answers

Answer:

True

Explanation:

The thick net medium consisted of a thin coaxial cable.

The __ is the section of a cpu core that performs arthimetic involving integers and logical operations

Answers

The Arithmetic/Logic Unit

The ____ component of an information system consists of raw facts and by itself

Answers

Answer: Data

Explanation: Data can be quantitative or qualitative. Information is data that has been given context. Knowledge is information that has been aggregated and analyzed and can be used for making decisions.

Final answer:

The 'data' component of an information system is a collection of raw facts and observations. Once data is put into context, it becomes 'information,' which refers to processed and valuable knowledge from the raw data. Computing technologies are instrumental in transforming data into information and support tasks like data storage and analysis.

Explanation:

The data component of an information system consists of raw facts and by itself represents measurements or observations of phenomena. Data is the foundational element from which information is produced in an information system, such as a database management system. When data is contextualized, interpreted, and analyzed, it then becomes information, which is valuable knowledge used to answer questions and make decisions. In the context of a Geographic Information System (GIS), for example, data might include the measurements of mountain peaks or the number of people using public transportation, while information is what we derive from analyzing these measurements to understand trends or patterns.

Information technology, such as computers, facilitates the transformation of data into information by automating repetitive tasks, storing data efficiently, and offering tools for complex analyses. This technology is essential in collecting the immense quantities of data from sources like satellites and smartphones, enabling us to turn these raw facts into actionable insights.

You need a disk system that provides the best performance for a new application that frequently reads and writes data to the disk. You aren't concerned about disk fault tolerance because the data will be backed up each day; performance is the main concern. What type of volume arrangement should you use?

Answers

a. Spanned volume

b. RAID 1 volume

c. RAID 0 volumed

RAID 5 volume

____________ is the practice of hiding data and keeping it away from unauthorized users.

A. Cryptography

B. Ciphertext

C. Cybersecurity

D. Encryption

Answers

Answer:

D.

Explanation:

A. Cryptography, D is not the correct answer because it is a process not a practice.

Write a program that will askthe user to enter the amount of a purchase. The program should thencompute the state and county sales tax. Assume the state sales tax is4 percent and the county sales tax is 2 percent. The program should displaythe amount of the purchase, the state tax, the county sales tax, the total salestax, and the total of the sale. (which is the sum of theamount of purchase plus the total sales tax). Hint: Use the value 0.02 torepresent 2 percent, and 0.04 to represent 4 percent.

Answers

Info:

I am doing it in Python. Hope it will help you.

Code:

am = float(input('Enter the amount: '))

stx = (am*0.04)

slt= (am*0.02)

tl = stx+slt+stx

print(f'Sales Tax: {slt}, State Tax: {stx}, Grand Total: {tl}')

Result:

Enter the amount: 15

Sales Tax: 0.3, State Tax: 0.6, Grand Total: 1.5

It is important to remember that in a supply? chain, the only source of revenue is the? _______.manufacturer/customer/raw material supplier/distributor/retailer

Answers

probably the retailer

Most information security incidents will occur because of _________. Select one: a. Users who do not follow secure computing practices and procedures b. Increases in hacker skills and capabilities c. Poorly designed network protection software d. Increasing sophistication of computer viruses and worms

Answers

Answer:

Users who do not follow secure computing practices and procedures

Explanation:

Most data breaches that occur as a result of hacking and cyber-attacks get all the attention. However, the kind of mistakes that employees make in corporate situations can sometimes be very costly. Whether accidental or not, human error is the leading cause of most information security breaches. When you have proper policies, people working in big organizations, for instance, will know how they are to do with them. Organizations should put more effort on its employees. By ensuring that secure computing practices and procedures are followed, it will help guide the workforce more effectively.

Write an HTML document which contains two text fields, a button, and a div. The first text field should be labeled “Temperature”, and the second should be labeled “Wind Speed”. The button should have the text “Wind Chill” written on it. Write two functions with these headers: function compute() function windChill(tempF, speed) The first function (compute) must be called from the onclick attribute of the button and must do the following: get a temperature from the first text field get a wind speed from the second text field call the second function (windChill) store the value returned by windChill in a variable output the value returned by windChill to the div for the user to see The second function (windChill) must take a temperature in Fahrenheit as a parameter take a wind speed in miles per hour as a parameter calculate the wind chill factor as a temperature in Fahrenheit return the wind chill factor in Fahrenheit In other words, the second function (windChill) must not gather any input from a user and must not output anything for a user to see. Instead it must calculate and return the result which makes this second function very reusable in other projects. The formula for computing the wind chill factor is f = 35.74 + 0.6215 t − 35.75 s0.16 + 0.4275 t s0.16 where f is the wind chill factor in Fahrenheit, t is the air temperature in Fahrenheit, and s is the wind speed in miles per hour at five feet above the ground.

Answers

Answer:

I created a jsfiddle for this: https://jsfiddle.net/tonb/o7uv4cdm/26/

Explanation:

see jsfiddle.

The usual html and body tags are omitted for simplicity. For your stand-alone page you'll have to put them in, as well as additional tags for your inline scripting.

An HTML document with two text fields, a button, and a div is presented to calculate the wind chill factor. JavaScript functions 'compute' and 'windChill' extract user inputs, perform computations, and display the result.

Below is an example of an HTML document that fulfills the requirements of containing two text fields labeled "Temperature" and "Wind Speed", a button titled "Wind Chill", a div to display the result, and the associated JavaScript functions needed to calculate wind chill.

<!DOCTYPE html>
<html>
<head>
<title>Wind Chill Calculator</title>
<script>
 function compute() {
   var tempF = document.getElementById('temperature').value;
   var speed = document.getElementById('windSpeed').value;
   var chill = windChill(tempF, speed);
   document.getElementById('result').innerText = chill;
 }

 function windChill(tempF, speed) {
   var t = parseFloat(tempF);
   var s = parseFloat(speed);
   if (t <= 50 && s > 3) {
     var f = 35.74 + 0.6215 * t - 35.75 * Math.pow(s, 0.16) + 0.4275 * t * Math.pow(s, 0.16);
     return f.toFixed(2);
   } else {
     return "N/A";
   }
 }
</script>
</head>
<body>
<label>Temperature (℉): <input type="text" id="temperature"></label>
<br>
<label>Wind Speed (mph): <input type="text" id="windSpeed"></label>
<br>
<button onclick="compute()">Wind Chill</button>
<div id="result"></div>
</body>
</html>

The compute function is responsible for retrieving values from the input fields, calling the windChill function with those values, and then displaying the result. The windChill function takes the temperature and wind speed, calculates the wind chill factor using the provided formula, and then returns it for display.

Are technical skills or people skills more important to the team manager in a software development project?

Answers

Answer:

A well-rounded team manager in a software development project is critical to its success. Having the best developers only gets you so far. Without proper leadership, the project will most likely fail. Developers won't know what direction to go, deadlines won't be met, and the end product will not be created to the specifications as set forth in the project. A software development team manager needs to possess both the proper technical skills to guide the developers when they get stuck, but more importantly have the proper people skills and business process skills to allow the team to work as a well-oiled machine. In this paper, we will look at two different types of team managers and how they affect the software development lifecycle.

Good communication helps

What is the ethical danger of using agents in negotiation?

Answers

information sharing, divergent interests, conflicting interests

What are the differences between Layered and Client-Server Architecture?

Answers

The differences between Layered and Client-Server Architecture is Client-Server Architecture is a shared architecture system where loads of client-server are divided, whereas layered architecture is a software architecture in which the different software components, organized in tiers (layers).

Further explanation

Software architecture is the fundamental structures of a software system. On the application level, the two most common architectures are client/server and layered architecture.

Client-Server Architecture is a shared architecture system where loads of client-server are divided. In client/server architecture, the database system has two parts such as a front-end or a client, and a back-end or a server.

Multitier or layered architecture (often referred to as n-tier architecture) is a software architecture in which the different software components, organized in tiers or layers and it provide such dedicated functionality. Examples of layered architecture are print, directory, or database services.

Learn more

1. Learn more about Client-Server Architecture https://brainly.in/question/9279200

 

Answer details

Grade:  9

Subject: Computers and Technology

Chapter:  software architecture

Keywords:   software architecture, Client-Server Architecture, Layered architecture

Which text function capitalizes the first letter in a string of text?
Question 10 options:

UPPER

CAPITAL

FIRST

PROPER

Answers

For python string.capitalize() works


I would think CAPITAL
The answer is supposed to be Upper

Explain the role auditing plays in the context of achieving trustworthy systems.

Answers

The role of auditing in achieving trustworthy systems include the following:1.Building of checkpoints for security throughout..

Write a program that has a conversation with the user. The program must ask for both strings and numbers as input. The program must ask for at least 4 different inputs from the user. The program must reuse at least 3 inputs in what it displays on the screen. The program must perform some form of arithmetic operation on the numbers the user inputs. Please turn in your .py file as well as a screenshot of your program's output. Please include comments in your code to explain how it works An example program run might look like (have fun with this and be creative): ‘What is your name?’ “Josh” ‘Thanks, Josh. What is your favorite color?’ “green” ‘Mine too. Do you also like Ice Cream?’ “No” ‘Josh, how old are you?’ “40” ‘... and how many siblings do you have?’’ “3” ‘That means you are one of 4 kid(s). Is green the favorite color of anyone else in your house?’

Answers

Answer:

yo im sorry eat my cookie

Explanation

doorkoeeworkwoeroewkrwerewrwe

What is process and what do you know about process control block?

Answers

hello! mark me brainliest please

Process Control Block is a data structure that contains information of the process related to it. The process control block is also known as a task control block, entry of the process table, etc. ... It also defines the current state of the operating system.

What time does the clerk set its clock to?

Answers

Answer:

the correct corresponding time of the time zone the clerk is in

Explanation:

is this a multiple choice?

Which of the following regarding the Ames test is true? a. It is used to identify newly formed auxotrophic mutants. b. It is used to identify mutants with restored biosynthetic activity. c. It is used to identify spontaneous mutants. d. It is used to identify mutants lacking photoreactivation activity.

Answers

Answer:

A

Explanation:

The answer to this question is option b. The Ames test is used to identify mutants with restored biosynthetic activity.

The Ames test makes use of bacteria to ascertain if mutation can occur in the DNA of an organism using a certain chemical compound.

It can also be used to test if a drug possesses  mutagenic properties. The bacteria strain that is used is the Salmonella typhimurium. The mutation of this bacteria occurs in histidine.

Read more at https://brainly.com/question/13052478?referrer=searchResults

1. Think about the various ways in which you have seen hackers portrayed in popular media over the past few years. Are they heroic characters or dangerous criminals? Do the representations conform to any of the realities of the hacker subculture, or do they simply further stereotypes about hackers as a whole?

Answers

They are definitely not heroic characters, so you can rule that out. Definitely dangerous criminals. If you need me to help further I can. Is that a question or an essay?

Final answer:

Portrayals of hackers in media often simplify or sensationalize the hacker subculture, overlooking its complexity and diversity. Understanding the motivations behind hacking activities is crucial, yet resources tend to focus more on technological defenses than on the individuals involved. There is a need to differentiate between hackers and to develop a nuanced view of their activities and ethical considerations.

Explanation:

Popular media often portray hackers as either noble outlaws or dangerous criminals, leaning into stereotypes that may not accurately reflect the realities of the hacker subculture. This binary representation overlooks the complex motivations and ethical frameworks within which many hackers operate. For instance, while some hackers engage in criminal activities for personal gain, others are driven by political ideologies, aiming to expose corruption or promote transparency, akin to what has been observed with groups like Wikileaks.

There is a growing need to differentiate between various types of hackers, rather than lumping them together in a single, often negative, caricature. Understanding who is hacking and why is crucial, yet, as highlighted in discussions, resources are mainly funneled into technological defenses rather than exploring the psychological and sociological aspects of hacking. This approach fails to address the root causes or motivations behind hacking activities, whether they are for malicious purposes, curiosity, or whistleblowing.

Moreover, the representation of hackers in media fails to capture the diversity within the hacker community, which is not monolithic. Attributes commonly ascribed to hackers, such as being male, bright, and socially withdrawn, might resonate with certain stereotypes but do not universally apply. The comparison of some hackers' behavior to that of corporations, as described by Joel Bakan, suggests a need to critically evaluate and understand the ethical dimensions and the potential for 'psychotic' behavior within both entities.

Describe the Wal-Mart?

Answers

Answer:

The largest discount retailer in the world. The company started out as a small chain of stores in rural towns. The store chain was founded by Samuel Walton in 1962 and currently is one of the largest employers in the United States. The store has been criticized for running smaller "mom and pop" stores out of business with its extremely low prices. Some of the stores are considered Super Wal-Marts and they typically provide a grocery store and automotive repair shop for customers.

A(n) _____ uses spatial and nonspatial data and specialized techniques for storing coordinates of networks of lines (roads, rivers, streets) and reporting zones (zip codes, cities, counties, states).

Answers

Answer:

A geographic information system (GIS) uses spatial and nonspatial data and specialized techniques for storing coordinates of networks of lines (roads, rivers, streets) and reporting zones (zip codes, cities, counties, states).

what are 2 of system software and how are they used?

Answers

Answer:

System software is software on a computer that is designed to control and work with computer hardware. The two main types of system software are the operating system(Windows,Linux,Mac OS)  and the software installed with the operating system, often called utility software (Anti virus, Disk formatting, Computer language translators) . In some cases, the operating system and utility software depend on each other to function properly.

Some system software is used directly by users and other system software works in the background. System software can allow users to interact directly with hardware functionality, like the Device Manager and many of the utilities found in the Control Panel.

What is a method in OOP? What is a member function?

Answers

Answer:The two pieces are put together and compiled for usage. User defined types provide encapsulation defined in the Object Oriented Programming

Explanation:

The main circuit board inside the system uit is called megaboard / true or false

Answers

True I would believe

. ___________ is the duty of every government that wants to ensure its national security.

A. Cybersecurity

B. Connectivity

C. Policy

D. Defense

Answers

Answer:

your answer is d wish it helps you

D is the correct answer

In the CSMA/CD random access method, if the maximum propagation time is 100 micro seconds and the station has unsuccessfully attempted transmission ten times, the maximum amount of time the station waits before the next attempt to send is:

a. 51,200 micro seconds

b. 204,800 micro seconds

c. 102,400 micro seconds

d. None of the above

Answers

b. 204,800 Micro seconds

What is the relation between Information and Data?

Answers

Answer:

In a sentence: data is raw numbers, while information is organized data.

Explanation:

Data is a series of numbers or facts.  A data set is a collection of data that are related (for examples all the students result in your last math exam).  But it's not organized by itself... and rarely mean anything when looked at it in a raw manner.

To make sense of a data collection, you have to analyze it, calculate the mean or median of the data set for example... this is a treatment that has to be done to a data set to give it significance.. after such analysis, the result you have (mean, median, etc..) is a piece of information devired from the data.

Rom also called main memory or system memoryis used to stor the essential parts of the operating while the computer is running / true or false

Answers

RAM*

But yes true, it’s a primary, volatile system

Draw the resistor’s voltage and current phasors at t=15ms. Draw the vectors with their tails at the origin. The orientation of your vectors will be graded. The exact length of your vectors will not be graded.

Answers

Answer: 22tm is the answer

Explanation:

Answer:

Please see attachment

Explanation:

Please see attachment

Other Questions
The _______ is a process often used by scientists to help them solve problems. How many solutions does this linear system have?y = 2x-5_8x - 4y = -20one solution: (-2.5, 0)one solution: (2.5, 0)Ono solutionO infinite number of solutions Select the correct graph.The blue curve on the graph represents the original population of a species of white rabbits. Which graph shows directional selection that occurs in a species? If f(x) = -4x2 - 6x-1 and g(x) = x2 - 5x + 3, find (f+ g)(x). Asah Otak susun kata menjadiNama2 50 makanan di malaysia1. naaaapkrielikk= 2. eeiegnmogr= 3. uugatpsl=4. noogtl= 5. manasiay=6. rakeub=7. purabccma=8. salka= 9. ommast= 10. yammot= 11. ggenibhnoru=12. lsnaaadiigg=13. doencl=14. maniskale= 15. kamlsa=16. loddo= 17. kakmaipilicaksam=18. rabanikka=19. aauubngbrkc=20. mmaaayukr=21. masadepas= 22. hunsupbi= 23. yisnamursa=24. gatisaar=25. aaurletddr= 26. aaticpp= 27. gankep= 28. taepilambas= 29. eeeurllhti=30. sobka= 31. aaookktt=32. rcaaotnii= 33. emeamasasdp=34. Iisrmka= 35. errubg= 36. cchhopienk= 37. kabtarma= 38. uuccuagdnr =39. yptstianaaa =40. bbeka = 41. gmlonpa= 42. ggjkraaunab =43. gocjfohgukanc =44. aets = 45. hnotrjih = 46. eeeiptsg = 47. woeeucthykr =48. uucgbbrknaa = 49. iuutanrtpld =50. Milha= Which country is the largest translate each phrase into an algebraic expression the quotation of 30 and three times a number HELPPP MEEE PLEASSSE ASAP IT WOULD MEAN ALOT What is the radius of a circle whose equation is x2 + y2 10x + 6y + 18 = 0? units What is the slope of the line represented by the values in the table? (10,14) (2,-2) What is the inverse of the function f(x) = 2x + 1? The distance Din miles from an observer to the horizon over flat land or water can be estimated using the formula D-123/where h is the height in feet of the point of observation. How far is the horizon for aperson whose eyes are 6 feet above theground?a about 5.91 mic. about 3.01 mib. about 2.73 mid. about 7.64 mi Compare and contrast scientific theory and scientific law A team of runners is needed to run a 1 3 -mile relay race. If each runner must run 1 9 mile, how many runners will be needed? Which empire was called "The Sick Man of Europe?" Collin did the work to see if 10 is a solution to the equation r/4=2.4 Need help with a math question Solve for x: -6 < x-1 < 9 What is Freytags Pyramid? Calculate the enthalpy of the following reaction: 4 B (s) + 3 O2 (g) 2 B2O3 (s) given the following pertinent information: (A) B2O3 (s) + 3 H2O (g) 3 O2 (g) + B2H6 (g), HoA = +2035 kJ (B) 2 B (s) + 3 H2 (g) B2H6 (g), HoB = +36 kJ (C) H2 (g) + LaTeX: \frac{1}{2} 1 2 O2 (g) H2O (l), HoC = 285 kJ (D) H2O (l) H2O (g), HoD = +44 kJ