0% found this document useful (0 votes)
4 views2 pages

Python Basics: Key Concepts Explained

The document provides a series of questions and answers related to Python programming concepts. Key topics include variables, string manipulation, loops, functions, lists, tuples, and error handling. It serves as a quick reference for fundamental Python knowledge.

Uploaded by

redha.sabt13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Python Basics: Key Concepts Explained

The document provides a series of questions and answers related to Python programming concepts. Key topics include variables, string manipulation, loops, functions, lists, tuples, and error handling. It serves as a quick reference for fundamental Python knowledge.

Uploaded by

redha.sabt13
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Extra Practice: Python

1) What is the purpose of variables in Python?


Answer: To store and reuse values.
2) How do you join strings?
Answer: With +.
3) What is the difference between = and = =?
Answer: = assigns, = = compares.
4) What is the output of print (10//3)?
Answer: 3.
5) How do you create a function?
Answer: With the def keyword.
6) What is a loop used for?
Answer: To repeat tasks.
7) How do you stop a loop?
Answer: Using break.
8) What is the use of else with if?
Answer: Runs when the condition is false.
9) How do you add an item to a list?
Answer: Using append ().
10) What is indexing in Python?
Answer: Accessing items by position.
11) What is slicing?
Answer: Getting part of a list or string.
12) What does range (5) do?
Answer: Gives numbers 0 to 4.
13) What is the output of print (5>2)?
Answer: True.
14) How do you find the type of a value?
Answer: Using type ().
15) What is a syntax error?
Answer: A mistake in code writing.
16) What is concatenation?
Answer: Joining strings together.
17) What is a tuple?
Answer: An unchangeable list.
18) What is the difference between list and tuple?
Answer: List can change, tuple cannot.
19) What does while loop do?
Answer: Repeats while the condition is true.
20) What does import math do?
Answer: Loads math functions.

You might also like