2 Which of the following is used to write multi-line comments in Python? A # B Triple quotes C // D /* */
3 Which of the following is used to declare a variable in Python? A var B int C No declaration needed D declare
4 What is the purpose of the int() function in Python? A To convert a value to integer B To convert a value to string C To convert a value to float D To convert a value to boolean
5 Which of the following is an IDE for Python? A PyCharm B Eclipse C Visual Studio Code D All of these
6 Which of the following is true about Python variables? A They must be declared with a data type. B They can change their data type during execution. C They cannot store strings. D They must start with a digit.
7 Which of the following is the correct way to start a Python program? A Start with main() B Write code directly C Use #include D Use public static void main
8 What is the purpose of the # symbol in Python? A To start a comment B To end a comment C To print a value D To assign a value
9 Which statement about variables in Python is correct? A A variable name can start with a digit B A variable must be declared with its type C A variable is created when a value is assigned to it D A variable name can contain spaces
10 Which operator has the highest precedence in Python? A Addition (+) B Parentheses () C Multiplication (*) D Assignment (=)
11 What is the correct way to declare a multi-line comment in Python? A Using # at each line B Using ''' or """ triple quotes C Using // at each line D Using /* */
12 Which of the following is the correct way to write a multi-line comment in Python? A # comment 1 # comment 2 B Using triple quotes (''' ''') C // comment D -- comment
13 What is the purpose of the Python statement: import math? A To define a new function B To include the math module C To create a variable D To print a message
14 پائتھن میں کس آپریٹر کی precedence سب سے زیادہ ہے؟ A جمع (+) B ضرب (*) C ایکسپونینٹیشن (**) D اسائنمنٹ (=)
16 In Python, variables are created when a value is assigned to them. This means Python is a: A Strongly typed language only B Dynamically typed language C Compiled language D Markup language
17 Which of the following is used to install Python on a computer? A Python installer B Python compiler C Python interpreter D Python editor
18 What is the correct way to write a multi-line comment in Python? A Use # before each line B Use /* */ C Use ''' ''' or """ """ D Use //
20 What is the purpose of the print() function in Python? A To take input from user B To display output on the screen C To comment the code D To declare a variable
21 پائتھن میں print() فنکشن کیا کرتا ہے؟ A صارف سے ان پٹ لیتا ہے B سکرین پر آؤٹ پٹ دکھاتا ہے C متغیر میں ڈیٹا محفوظ کرتا ہے D متغیر کو حذف کرتا ہے
22 Which of these is used to define a block of code in Python? A Curly braces { } B Indentation C Parentheses ( ) D Square brackets [ ]
23 How do you write a string in Python? A Enclosed in single or double quotes B Enclosed in square brackets C Enclosed in curly braces D Without any quotes
24 What is the purpose of an IDE in Python programming? A To write and run programs in one place B To increase the speed of the computer C To create web pages only D To print documents
25 Which of the following is used to define a block of code in Python? A Parentheses () B Curly braces {} C Indentation D Square brackets []