Report an error if the input string does not contain a comma

Assignment Help Computer Engineering
Reference no: EM132112846

In python please make a simple code for this prompt. Thanks

(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt)

Examples of strings that can be accepted:

Jill, Allen

Jill , Allen

Jill,Allen

Ex: Enter input string: Jill, Allen

(2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts)

Ex: Enter input string: Jill Allen Error: No comma in string. Enter input string: Jill, Allen

(3) Using string splitting, extract the two words from the input string and then remove any spaces. Output the two words. (2 pts)

Ex: Enter input string: Jill, Allen First word: Jill Second word: Allen

(4) Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit. (2 pts)

Ex: Enter input string: Jill, Allen First word: Jill Second word: Allen Enter input string: Golden , Monkey First word: Golden Second word: Monkey Enter input string: Washington,DC First word: Washington Second word: DC Enter input string:

Reference no: EM132112846

Questions Cloud

Write a python program that prompts for an integer : Write a Python program that prompts for an integer-let's call it X-and then ands the sum of X consecutive integers starting at 1.
Create a program that decodes caesar ciphers : Find the shift from "E" to that most common character. Use the shift to decode each character of the cipher-text and print the resulting plain-text.
Find the probability of the second aircraft : We are tasked with trying to find the probability of the second aircraft finding the submarine during the gap or lapse of time between aircraft 1 leaving
Write a function called make payment : Write a function called "make payment(P)" that takes as an argument the total payment on the credit card ($P) and prints "Success" or "Retry."
Report an error if the input string does not contain a comma : Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered.
Prompt for the length in metres using python code : Your program should then do three conversions to output the equivalent distance in feet, yards, and miles.
Will robots and artificial intelligence replace jobs : Will robots and artificial intelligence replace jobs in the future? What kind of jobs are most vulnerable? Provide examples of 2 jobs.
Write an expression whose value is the same : Write an expression whose value is the same as the str associated with s but with reversed case.
Design a python program that prompts the user to enter : Design a PYTHON program that prompts the user to enter a number and then you will build a multiplication table of that size.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd