Q. Which method checks if a string ends with a suffix?

A
endswith()
B
ends()
C
has_suffix()
D
end_check()
Solution:

endswith() checks if a string ends with a specified suffix, e.g., ‘file.txt’.endswith(‘.txt’) is True.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!