1 Which of the following is used to declare a variable in Python? A var B int C No declaration needed D declare
2 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
3 Which operator has the highest precedence in Python? A Addition (+) B Parentheses () C Multiplication (*) D Assignment (=)
4 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
5 Which of these is a valid Python comment? A // this is a comment B # this is a comment C /* this is a comment */ D <!-- this is a comment -->
6 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
7 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
8 پائتھن میں کس آپریٹر کی precedence سب سے زیادہ ہے؟ A جمع (+) B ضرب (*) C ایکسپونینٹیشن (**) D اسائنمنٹ (=)
9 Which of the following is used to define a block of code in Python? A Parentheses () B Curly braces {} C Indentation D Square brackets []
10 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 //
11 پائتھن میں print() فنکشن کیا کرتا ہے؟ A صارف سے ان پٹ لیتا ہے B سکرین پر آؤٹ پٹ دکھاتا ہے C متغیر میں ڈیٹا محفوظ کرتا ہے D متغیر کو حذف کرتا ہے
12 Which of the following is used to install Python on a computer? A Python installer B Python compiler C Python interpreter D Python editor
13 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
14 Which of the following is an IDE for Python? A PyCharm B Eclipse C Visual Studio Code D All of these
15 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
16 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
17 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
18 Which of the following is used to write multi-line comments in Python? A # B Triple quotes C // D /* */
20 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
23 Which of the following is the correct way to create a multi-line comment in Python? A Using // at the start of each line B Using triple quotes (''' or """) C Using /* and */ D Using # at the end of each line
24 Which of these is used to define a block of code in Python? A Curly braces { } B Indentation C Parentheses ( ) D Square brackets [ ]
25 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.