Questions and Answers 100% Pass
How can you convert a number to an integer in Python?
✔✔ Use the `int()` function.
What is the result of `2 ** 3` in Python?
✔✔ The result is `8`.
How do you add two numbers in Python?
✔✔ Use the `+` operator.
What is a tuple in Python?
✔✔ A tuple is an immutable, ordered collection of items.
How can you check the length of a collection in Python?
✔✔ Use the `len()` function.
1
, How do you access the first element of a collection?
✔✔ Use index `0`.
What is the purpose of the `input()` function?
✔✔ The `input()` function is used to take user input.
How do you create a dictionary in Python?
✔✔ A dictionary is created using curly braces with key-value pairs.
What is the result of `` in Python 3?
✔✔ The result is `2.5`.
How do you check if a value exists in a collection?
✔✔ Use the `in` operator.
What is the difference between `==` and `is` in Python?
✔✔ `==` checks for value equality, while `is` checks if two objects are the same.
2