#4) store a persons name, and include some whitespace characters at the beginning and end of the name. make…

#4) store a persons name, and include some whitespace characters at the beginning and end of the name. make sure you use each character combination, \\\t\ and \\\n\, at lease once. print the name once, so the whitespace around the name is displayed. then print the name using each of the three stripping functions, lstrip(), rstrip(), and strip(). (this means 3 additional times printing out the name, 4 total).
Answer
Explanation:
Step1: Store the name with whitespace
name = "\n\t John Doe \t\n" print(name)
Step2: Use lstrip() function
print(name.lstrip())
Step3: Use rstrip() function
print(name.rstrip())
Step4: Use strip() function
print(name.strip())
Answer:
The code above first stores a name "John Doe" with whitespace characters (\n and \t) at the beginning and end. Then it prints the name as - is, and then prints the name after applying lstrip(), rstrip() and strip() functions respectively. The actual output will be: \n\t John Doe \t\n (original with whitespace) John Doe \t\n (after lstrip()) \n\t John Doe (after rstrip()) John Doe (after strip())