Python - Unit 1
46 flashcards · Programming Languages · by Sikkandharbatcha J
Which Python mode allows you to execute code line by line immediately?
Interactive mode
Which Python mode is used to execute an entire file of code?
Script mode
What is the main feature of Python's interactive mode?
Immediate execution of commands
In script mode, code is generally written and saved in which type of file?
Saved in .py file
What prompt symbol is shown in Python interactive mode?
>>> prompt
Which of the following is a popular Python IDE?
PyCharm
Which IDE comes bundled with Python?
IDLE
Which Python IDE is most used for data science and visualization?
Jupyter Notebook
Which code editor is widely used for Python and supports extensions?
Visual Studio Code
What does IDE stand for?
complex
Which data type is used to represent whole numbers in Python?
int
Which data type is used to represent decimal numbers?
float
Which data type is used to represent text in Python?
str
Which data type is ordered, mutable, and allows duplicates?
list
Which data type is ordered, immutable, and allows duplicates?
tuple
Which data type is unordered, mutable, and does not allow duplicates?
set
Which data type stores key-value pairs?
dict
What is the output of bool(5)?
true
Which data type is used to represent numbers with real and imaginary parts?
complex
Lists in Python are?
mutable
Which operator is used for assignment in Python?
=
Which operator is used for addition in Python?
+
Which operator checks equality between two values?
=
Which logical operator returns True if both conditions are True?
and
Which logical operator returns True if at least one condition is True?
or
Which logical operator negates a condition?
not
Which bitwise operator performs AND operation?
&
Which bitwise operator performs OR operation?
|
Which operator is used to check membership in lists, tuples, or sets?
in
Which operator checks object identity?
is
Which function is used to read input from the user?
input()
Which function is used to display output to the console?
print()
Which parameter in print() is used to specify separator between values?
sep
Which parameter in print() is used to specify what is printed at the end?
end
Which format specifier is used for integers?
%d
Which format specifier is used for floating-point numbers?
%f
Which format specifier is used for strings?
%s
Which function converts a string to an integer?
int
Which function converts a string to a floating-point number?
float
Which function converts a number to a string?
str
What is the output type of split() method in Python?
list
Which data type is created using curly braces with key-value pairs?
dictionary
What is the index of the first element in a Python list?
Which function is used to find the number of items in a list?
len()
Which function generates a sequence of numbers?
range()