🤖 string handling and data validation

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

Flashcards covering string methods and data validation techniques in Python.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

What does string.strip() do?

Removes leading and trailing whitespace from a string.

2
New cards

What does string.replace(old, new) do?

Replaces all occurrences of 'old' with 'new' in a string.

3
New cards

What does string.isdigit() check?

Checks if the string contains only digits and returns True if it does, False otherwise.

4
New cards

What does string.isalpha() check?

Checks if the string contains only letters and returns True if it does, False otherwise.

5
New cards

What does string.isalnum() check?

Checks if the string contains only letters and numbers and returns True if it does, False otherwise.

6
New cards

What does string.startswith(sub) do?

Checks if the string starts with the substring 'sub' and returns True if it does, False otherwise.

7
New cards

What does string.endswith(sub) do?

Checks if the string ends with the substring 'sub' and returns True if it does, False otherwise.

8
New cards

What is a length check in data validation?

Ensures the input meets a specific length requirement.

9
New cards

What is a range check in data validation?

Ensures the input is within a certain numeric range.

10
New cards

What is a type check in data validation?

Ensures the input is of a specific data type.

11
New cards

What is a presence check in data validation?

Ensures that a required field is not left blank.

12
New cards

What is a format check in data validation?

Ensures the input follows a specific pattern (e.g., email format).

13
New cards

What is a lookup check in data validation?

Ensures the input is one of a set of acceptable values.