Back to marketplace

Data Types And String Manipulation

No description yet. This curated deck is ready for daily study.

Total cards: 16•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (16)

#1
Front (Question)

What is a data type?

Back (Answer)

A classification that tells the computer what kind of data is being used and how it should be stored and processed.

#2
Front (Question)

What are the main data types in Python?

Back (Answer)

• Integer (int): Whole numbers (e.g., 5, -10) • Float: Decimal numbers (e.g., 3.14, -0.01) • String (str): Text enclosed in quotes (e.g., “hello”) • Boolean (bool): True or False

#3
Front (Question)

What is a string in Python?

Back (Answer)

A sequence of characters enclosed in quotation marks (e.g., “Computer”).

#4
Front (Question)

How can you access characters in a string in Python?

Back (Answer)

Using indexing: string[index], where indexing starts at 0. For example, “hello”[1] returns “e”.

#5
Front (Question)

How do you get the length of a string in Python?

Back (Answer)

Use the len() function — e.g., len(“hello”) returns 5.

#6
Front (Question)

How do you slice a string in Python?

Back (Answer)

Using string[start:end], which returns characters from the start index up to but not including the end index. Example: “hello”[1:4] returns “ell”.

#7
Front (Question)

What does string.upper() do in Python?

Back (Answer)

Converts all letters in the string to uppercase.

#8
Front (Question)

What does string.lower() do in Python?

Back (Answer)

Converts all letters in the string to lowercase.

#9
Front (Question)

What does string.strip() do in Python?

Back (Answer)

Removes whitespace (or other characters) from the beginning and end of the string.

#10
Front (Question)

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

Back (Answer)

Replaces all instances of the old substring with new. Example: “hello”.replace(“l”, “x”) → “hexxo”.

#11
Front (Question)

What does string.find(sub) do in Python?

Back (Answer)

Returns the index of the first occurrence of the substring sub. If not found, it returns -1.

#12
Front (Question)

How do you concatenate (join) strings in Python?

Back (Answer)

Use the + operator. Example: “Hello “ + “World” → “Hello World”.

#13
Front (Question)

How do you convert a string to an integer in Python?

Back (Answer)

Use int(string). For example: int(“5”) → 5.

#14
Front (Question)

How do you convert an integer to a string in Python?

Back (Answer)

Use str(integer). For example: str(10) → “10”.

#15
Front (Question)

What is string iteration in Python?

Back (Answer)

Using a loop to go through each character in a string, e.g.: for letter in “hello”: print(letter)

#16
Front (Question)

Why is it important to understand string manipulation in programming?

Back (Answer)

Because strings are used frequently in input/output, data processing, and communication with.