QuestionQ20

VerifiedPython Basics for Data Analysis

Given this string:

text = "Report2024Final"

Which of the following statements are fully correct?

Choose two
Explanation

str.isdigit() returns True when every character in a nonempty string is a digit, so the slice "20" satisfies it; endswith("Final") also returns True. The slice "Report" is entirely alphabetic, and str.find("2024") returns the zero-based starting position of that substring, which is 6. Python documents these string-method behaviors in its built-in types reference.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!