1. What is the difference between a list and a tuple in Python?
- List: A list is mutable, meaning its elements can be modified after creation.
Syntax:my_list = [1, 2, 3]
- Tuple: A tuple is immutable, meaning its elements cannot be modified after creation.
Syntax:my_tuple = (1, 2, 3)
2. What is the purpose of the break
and continue
statements in Python?
break
: Exits the nearest enclosing loop prematurely.
Example:
for i in range(5):
if i == 3:
break
print(i) # Output: 0, 1, 2
continue
: Skips the rest of the code inside the loop for the current iteration and moves to the next iteration.
Example:
for i in range(5):
if i == 3:
continue
print(i) # Output: 0, 1, 2, 4

3. Explain the concept of encapsulation in Object-Oriented Programming.
Encapsulation is the process of bundling data (attributes) and methods (functions) into a single unit, typically a class, and restricting direct access to some of the object’s components to enforce control over how the data is accessed or modified.
4. Define foreign key and its significance in databases.
A foreign key is an attribute in one table that links to the primary key of another table. It is used to maintain referential integrity in relational databases
5. What is the difference between static and dynamic typing in programming?
- Static Typing: Data types are checked at compile-time. Example: C, Java.
- Dynamic Typing: Data types are checked at runtime. Example: Python, JavaScript
6. What is the role of the DNS (Domain Name System)?
The DNS translates human-readable domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1) that computers use to identify each other on the network.
7. Differentiate between HTTP and HTTPS.
- HTTP: Stands for HyperText Transfer Protocol and transfers data as plain text.
- HTTPS: Stands for HyperText Transfer Protocol Secure and encrypts data using SSL/TLS for secure communication.
8. What are logic gates? Give examples.
Logic gates are basic building blocks of digital circuits that perform logical operations like AND, OR, NOT, NAND, NOR, XOR, and XNOR.
Example:
- AND gate: Outputs 1 only when both inputs are 1.
- OR gate: Outputs 1 if at least one input is 1.
For More Information and Updates, Connect With Us*
- Name: Survi
- Phone Number: +91-7488713635
- Email ID: survi@eepl.me
- Our Platforms:
- Digilearn Cloud
- EEPL Test
- Live Emancipation
- Follow Us on Social Media:
- Instagram – EEPL Classroom
- Facebook – EEPL Classroom
- https://eepl.me/classes/index.php/blog/
Stay connected and keep learning with EEPL Classroom!