All Flashcards
What are the differences between a for loop and a while loop?
for loop: iterates a specific number of times or over a sequence. while loop: iterates as long as a condition is true.
What are the differences between functions and procedures?
Functions: return a value. Procedures: do not return a value.
What are the differences between lists and dictionaries?
Lists: ordered collections of items (mutable). Dictionaries: key-value pairs (unordered, mutable).
How is encryption applied in real-world scenarios?
Protecting sensitive data like passwords, credit card numbers, and personal information during online transactions.
How are algorithms applied in real-world scenarios?
Search engines use complex algorithms to rank search results, and social media platforms use algorithms to personalize content feeds.
How is data abstraction applied in real-world scenarios?
Using a car: you don't need to know how the engine works to drive it; you only need to know how to use the steering wheel, pedals, etc.
What is the definition of a string?
Ordered sequences of characters (text).
What is string indexing?
Accessing individual characters in a string using their position (starting from 0).
What is string slicing?
Extracting a portion (substring) of a string.
What is string concatenation?
Joining two or more strings end-to-end.
What is a boolean?
Represents truth values: True or False.
What is a variable?
Named storage locations in memory that hold values.
What is sequencing?
Executing code statements in order, one after another.
What is selection in programming?
Executing different blocks of code based on a condition (if/else).
What is iteration?
Repeating a block of code multiple times (loops).
What is a function?
Reusable blocks of code that perform a specific task and return a value.