Question: This is my code: How to remove the space below without modifying the strings from the print function? def get_part(text, index): return (text.replace( ,).strip().split('|')[index:index+1]) print(get_part('

This is my code:

This is my code: How to remove the space below without modifying

How to remove the space below without modifying the strings from the print function?

the strings from the print function? def get_part(text, index): return (text.replace(" ","").strip().split('|')[index:index+1])

def get_part(text, index): return (text.replace(" ","").strip().split('|')[index:index+1]) print(get_part(' John Doe | Male | ,0)) print(get_part('John Doe | Male | X,2)) print(get_part('Dog|Cat',, 0) ) [JohnDoe][X][Dog]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!