Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Write a single python program to perform the following tasks in order specified using the commands provided and discussed during class: KEEP IT SIMPLE

python image text in transcribed
Write a single python program to perform the following tasks in order specified using the commands provided and discussed during class: KEEP IT SIMPLE AND FOLLOW INSTRUCTIONS PROVIDED IN CLASSI 1. Create a string named stringA containing "hello" 2. Create a string named string containing "ecu" 3. If stringB is all lowercase, use a single command to concatenate stringA with first character capitalized followed by a single space and string converted to uppercase producing a new string named string. In the if statement, print resulting string to verify you received "Hello ECU" 4. Create a string named stringx containing Medusername:password:UID:GID:Name+123456:homedir:shell." 5. Use a single if statement command/condition to strip the excess colons from both ends and compare the remaining count of colons to 6. If the number of colons counted after excess have been stripped is 6, then use a combined strip and split command to create a list of the items separated by colons (excluding the excessive colons on ends) called list. Use a single print command in the if statement to print the contents of the list to verify you received is l'username', 'password', 'UID', 'GID', 'Name+123456', 'homedir', 'shell') 6. Use a single command to split the occurrence of the string 'Name+123456' in the list on the '+ and assign the second part of that resulting list to a new string called idnum. 7. If idnum contains all digits, print idnum to confirm it contains "123456" 8. Print stringx with : replaced by a maximum of 5 times. Output should be "I username password|UID GID:Name+123456:homedir:shelle: 9. Attempt to replace the 3rd item in the string idnum with X using direct assignment. Note: You should receive an error message indicating string objects do not support item assignment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

1. How might volunteering help the employer and the employee?

Answered: 1 week ago