6.6.1: WARM UP: PARSING STRINGS (PYTHON 3)

6.6 Warm up: Parsing strings (Python 3) (1) Prompt the user for a string that includes two strings separated by a comma. (1 pt) Instances of strings that deserve to be accepted: Jill, Allen Jill , Allen Jill,Allen Ex: Get in input string: Jill, Allen (2) Report.

I require assist with a Python question. All explacountries and answers will certainly be supplied to aid me learn.

6.6 Warm up: Parsing strings (Python 3)

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

Instances of strings that have the right to be accepted:Jill, AllenJill , AllenJill,Allen

Ex:

Go into input string: Jill, Allen_x000D_(2) Report an error if the input string does not contain a comma. Continue to prompt till a valid string is gotten in. Note: If the input contains a comma, then assume that the input also consists of 2 strings. (2 pts)

Ex:


You watching: 6.6.1: warm up: parsing strings (python 3)

Enter input string: Jill Allen_x000D_Error: No comma in string._x000D_Enter input string: Jill, Allen_x000D_(3) Using string splitting, extract the 2 words from the input string and then remove any type of spaces. Output the 2 words. (2 pts)

Ex:

Enter input string: Jill, Allen_x000D_First word: Jill_x000D_Second word: Allen_x000D_(4) Using a loop, extend the routine to manage multiple lines of input. Continue until the user enters q to quit. (2 pts)

Ex:

Get in input string: Jill, Allen_x000D_First word: Jill_x000D_Second word: Allen_x000D_Enter input string: Golden , Monkey_x000D_First word: Golden_x000D_Second word: Monkey_x000D_Go into input string: Washington,DC_x000D_First word: Washington_x000D_Second word: DC_x000D_Go into input string: q_x000D_

6.6 Warm up: Parsing strings (Python 3) (1) Prompt the user for a string that has 2 strings separated by a comma. (1 pt) Examples of strings that deserve to be accepted: Jill, Allen Jill , Allen Jill,Allen Ex: Enter input string: Jill, Allen (2) Report


“Get 15% discount on your initially 3 orders through us” Use the adhering to coupon FIRST15

*
*
*
*


© 2021 sibbap.org. All Reoffered


See more: Invalid Syntax Python Elif, If, Else, Elif :: Learn Python By Nina Zakharenko

×
Order Placed !
We use cookies to encertain that we provide you the best suffer on our website. If you continue to usage this site we will certainly assume that you are happy with it.Ok