User FAQs


1) Can you list Python's primary built-in data types ?
Boolean - bool
Text - str
Numeric - int, float, complex
Sequence - list, tuple, range
Mapping - dict
Set - set, frozenset
Binary - bytes, bytearray, memoryview


2) What is a tuple ?



3) What is the difference between lists, tuples and sets?
Lists, tuples, and sets are all used to store multiple items in a single variable, but they have different properties:
A list is ordered and changeable. It allows duplicate values.
A tuple is ordered but unchangeable (immutable). It also allows duplicates.
A set is unordered, unindexed, and contains only unique items. It is changeable, but you cannot modify individual elements by index.


4) When to use a tuple vs list vs dictionary in Python?
Use a tuple to store a sequence of items that will not change.
Use a list to store a sequence of items that may change.
Use a dictionary when you want to associate pairs of two items.


5) How can I convert between a tuple and a list ?



6) Which collection does not allow duplicate members?
Set


7) What is the difference between / and // in Python?
/ represents precise division (result is a floating point number)
// represents floor division (result is an integer)

print(5//2)     ' 2  
print(5/2) ' 2.5

8) What is the correct syntax to output the type of a variable or object in Python?

print(type(x)) 


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext