MCQz

Control Structures in Python

Computer Science · 10th Class (Matric Part 2) · BISE Lahore

150 questions

Tests for this chapter

Tests run in your chosen medium — the sample below shows both.

Control Structures in Python Test

10 questions · Control Structures in Python × 10

Full Book Test

40 questions · Operating Systems: Structure and Services × 5, System Recovery and Advanced Maintenance × 5, Introduction to Python Programming × 5, Control Structures in Python × 5, Introduction to Data Science × 5, Introduction to Artificial Intelligence and Machine Learning × 5, Applications of AI × 5, Digital Entrepreneurship × 5

Sample questions

Showing 20 of 150 questions from this chapter. The full bank is in the chapter test below.

  1. 1

    Which of the following is a learning outcome of this unit?

    درج ذیل میں سے کون سا اس یونٹ کا سیکھنے کا نتیجہ (Learning Outcome) ہے؟

    • A.Design web pages using HTML and CSSHTML اور CSS استعمال کر کے ویب صفحات ڈیزائن کرنا
    • B.Create slide presentationsسلائیڈ پریزنٹیشنز (Slide Presentations) بنانا
    • C.Implement control structures such as decision-making statements and loops in Python (correct answer)Python میں کنٹرول ڈھانچے (Control Structures) جیسے فیصلہ سازی کے بیانات اور لوپس (Loops) نافذ کرنا
    • D.Format text documents in a word processorورڈ پروسیسر (Word Processor) میں ٹیکسٹ دستاویزات کو فارمیٹ کرنا
    Why: The learning outcomes include implementing control structures such as decision-making statements and loops in Python.سیکھنے کے نتائج میں Python میں کنٹرول ڈھانچے جیسے فیصلہ سازی کے بیانات اور لوپس کو نافذ کرنا شامل ہے۔
  2. 2

    A learning outcome of this unit includes working with which of the following?

    اس یونٹ کے سیکھنے کے نتائج میں درج ذیل میں سے کس کے ساتھ کام کرنا شامل ہے؟

    • A.Python modules, functions, and built-in data structures like lists (correct answer)Python کے ماڈیولز (Modules)، فنکشنز (Functions) اور بلٹ ان ڈیٹا سٹرکچرز (Built-in Data Structures) جیسے فہرستیں (Lists)
    • B.Hardware circuit designہارڈویئر سرکٹ ڈیزائن (Hardware Circuit Design)
    • C.Operating system installationآپریٹنگ سسٹم (Operating System) انسٹال کرنا
    • D.Network router configurationنیٹ ورک روٹر (Network Router) کی ترتیب
    Why: Working with Python modules, functions, and built-in data structures like lists is one of the learning outcomes of the unit.Python کے ماڈیولز، فنکشنز اور بلٹ ان ڈیٹا سٹرکچرز جیسے فہرستوں کے ساتھ کام کرنا اس یونٹ کے سیکھنے کے نتائج میں سے ایک ہے۔
  3. 3

    The learning outcomes of this unit include applying which techniques in Python?

    اس یونٹ کے سیکھنے کے نتائج میں Python میں کون سی تکنیکیں استعمال کرنا شامل ہے؟

    • A.Photographic editing techniquesتصویری (Photographic) ایڈیٹنگ کی تکنیکیں
    • B.Audio mixing techniquesآڈیو مکسنگ (Audio Mixing) کی تکنیکیں
    • C.Video rendering techniquesویڈیو رینڈرنگ (Video Rendering) کی تکنیکیں
    • D.Modular programming techniques and object-oriented programming concepts (correct answer)ماڈیولر پروگرامنگ (Modular Programming) کی تکنیکیں اور آبجیکٹ اورینٹڈ پروگرامنگ (Object-Oriented Programming) کے تصورات
    Why: The learning outcomes include applying modular programming techniques and object-oriented programming concepts in Python.سیکھنے کے نتائج میں Python میں ماڈیولر پروگرامنگ کی تکنیکوں اور آبجیکٹ اورینٹڈ پروگرامنگ کے تصورات کا استعمال شامل ہے۔
  4. 4

    Which of the following is included in the learning outcomes of this unit?

    درج ذیل میں سے کون سا اس یونٹ کے سیکھنے کے نتائج میں شامل ہے؟

    • A.Managing social media accountsسوشل میڈیا اکاؤنٹس (Social Media Accounts) کا انتظام کرنا
    • B.Handling exceptions, performing file operations, and applying testing and debugging techniques (correct answer)استثنیات (Exceptions) کو سنبھالنا، فائل آپریشنز (File Operations) انجام دینا اور ٹیسٹنگ (Testing) اور ڈیبگنگ (Debugging) کی تکنیکیں استعمال کرنا
    • C.Designing logosلوگو (Logo) ڈیزائن کرنا
    • D.Creating animationsاینیمیشنز (Animations) بنانا
    Why: Handling exceptions, performing file operations, and applying testing and debugging techniques are listed among the learning outcomes.استثنیات کو سنبھالنا، فائل آپریشنز انجام دینا اور ٹیسٹنگ اور ڈیبگنگ کی تکنیکیں استعمال کرنا سیکھنے کے نتائج میں شامل ہیں۔
  5. 5

    In Python, strings can be written inside which of the following?

    Python میں سٹرنگز (Strings) درج ذیل میں سے کس کے اندر لکھی جا سکتی ہیں؟

    • A.Only single quotation marksصرف سنگل کوٹیشن مارکس (') کے اندر
    • B.Only double quotation marksصرف ڈبل کوٹیشن مارکس (") کے اندر
    • C.Either single or double quotation marks (correct answer)سنگل یا ڈبل کوٹیشن مارکس، دونوں میں سے کسی ایک کے اندر
    • D.No quotation marks at allبالکل کوئی کوٹیشن مارکس نہیں
    Why: In Python, strings are surrounded by either single quotation marks or double quotation marks, and both ways work.Python میں سٹرنگز سنگل یا ڈبل کوٹیشن مارکس کے اندر لکھی جا سکتی ہیں اور دونوں طریقے درست ہیں۔
  6. 6

    Which of the following is TRUE about the strings 'Ayyan' and "Ayyan" in Python?

    Python میں سٹرنگز 'Ayyan' اور "Ayyan" کے بارے میں درج ذیل میں سے کون سا بیان درست ہے؟

    • A.They are two different stringsیہ دو مختلف سٹرنگز ہیں
    • B.They are the same string (correct answer)یہ ایک ہی سٹرنگ ہے
    • C.One of them is a numberان میں سے ایک نمبر ہے
    • D.Both are invalidدونوں غلط ہیں
    Why: Strings in single quotes are the same as strings in double quotes, so 'Ayyan' is the same as "Ayyan".سنگل کوٹس میں لکھی گئی سٹرنگ اور ڈبل کوٹس میں لکھی گئی سٹرنگ ایک جیسی ہوتی ہے، اس لیے 'Ayyan' اور "Ayyan" ایک ہی سٹرنگ ہیں۔
  7. 7

    What is the main purpose of control structures in programming?

    پروگرامنگ میں کنٹرول ڈھانچوں (Control Structures) کا بنیادی مقصد کیا ہے؟

    • A.To create variablesمتغیرات (Variables) بنانا
    • B.To import librariesلائبریریاں (Libraries) درآمد (Import) کرنا
    • C.To make programs longerپروگراموں کو لمبا بنانا
    • D.To manage decision-making and repetition of tasks (correct answer)فیصلہ سازی (Decision Making) اور کاموں کی تکرار کا انتظام کرنا
    Why: Control structures help manage the decision-making process and the repetition of tasks in programs.کنٹرول ڈھانچے پروگراموں میں فیصلہ سازی کے عمل اور کاموں کی تکرار کو منظم کرنے میں مدد دیتے ہیں۔
  8. 8

    What are the two main types of control structures?

    کنٹرول ڈھانچوں کی دو اہم اقسام کون سی ہیں؟

    • A.Decision making and looping (correct answer)فیصلہ سازی (Decision Making) اور لوپنگ (Looping)
    • B.if and elseif اور else
    • C.while and forwhile اور for
    • D.Functions and modulesفنکشنز (Functions) اور ماڈیولز (Modules)
    Why: The two main types of control structures are decision making and looping.کنٹرول ڈھانچوں کی دو اہم اقسام فیصلہ سازی اور لوپنگ ہیں۔
  9. 9

    Which real-life decision is used to explain decision making in programming?

    پروگرامنگ میں فیصلہ سازی کی وضاحت کے لیے حقیقی زندگی کی کون سی مثال استعمال کی گئی ہے؟

    • A.Choosing a favourite colourپسندیدہ رنگ کا انتخاب کرنا
    • B.Choosing a school subjectاسکول کا مضمون منتخب کرنا
    • C.Deciding whether to take an umbrella based on the weather (correct answer)موسم کی بنیاد پر فیصلہ کرنا کہ چھتری لے جائیں یا نہیں
    • D.Choosing a movie to watchدیکھنے کے لیے فلم کا انتخاب کرنا
    Why: Deciding whether to take an umbrella based on the weather is used as an example of decision making.موسم کی بنیاد پر چھتری لے جانے یا نہ لے جانے کا فیصلہ فیصلہ سازی کی مثال کے طور پر استعمال کیا گیا ہے۔
  10. 10

    Control structures are essential because they help us manage which of the following?

    کنٹرول ڈھانچے ضروری ہیں کیونکہ یہ درج ذیل میں سے کس کا انتظام کرنے میں مدد دیتے ہیں؟

    • A.Only the storing of dataصرف ڈیٹا (Data) کو محفوظ کرنے کا
    • B.The decision-making process and the repetition of tasks (correct answer)فیصلہ سازی کے عمل اور کاموں کی تکرار کا
    • C.Only the naming of variablesصرف متغیرات کے نام رکھنے کا
    • D.Only the printing of outputصرف آؤٹ پٹ (Output) پرنٹ کرنے کا
    Why: Control structures are essential because they help manage the decision-making process and the repetition of tasks.کنٹرول ڈھانچے ضروری ہیں کیونکہ یہ فیصلہ سازی کے عمل اور کاموں کی تکرار کو منظم کرنے میں مدد دیتے ہیں۔
  11. 11

    Decision making in programming allows the program to do what?

    پروگرامنگ میں فیصلہ سازی پروگرام کو کیا کرنے کی اجازت دیتی ہے؟

    • A.Choose different actions based on conditions (correct answer)شرائط (Conditions) کی بنیاد پر مختلف اقدامات کا انتخاب کرنا
    • B.Repeat one action foreverایک عمل کو ہمیشہ کے لیے دہرانا
    • C.Stop executing any codeکوئی بھی کوڈ چلانا بند کر دینا
    • D.Print only numbersصرف نمبر پرنٹ کرنا
    Why: Decision making lets a program choose different actions based on conditions.فیصلہ سازی پروگرام کو شرائط کی بنیاد پر مختلف اقدامات کا انتخاب کرنے کی اجازت دیتی ہے۔
  12. 12

    What does an if statement do when its condition is true?

    if اسٹیٹمنٹ (if Statement) اپنی شرط درست ہونے پر کیا کرتا ہے؟

    • A.It stops the programیہ پروگرام کو روک دیتا ہے
    • B.It prints an error messageیہ ایرر میسج (Error Message) پرنٹ کرتا ہے
    • C.It repeats the conditionیہ شرط کو دہراتا ہے
    • D.It runs a block of code (correct answer)یہ کوڈ کا ایک بلاک (Block) چلاتا ہے
    Why: If the condition of an if statement is true, the block of code inside it runs.اگر if اسٹیٹمنٹ کی شرط درست ہو تو اس کے اندر کا کوڈ بلاک چلتا ہے۔
  13. 13

    In Python, what defines the block or scope of your code?

    Python میں آپ کے کوڈ کا بلاک یا دائرہ (Scope) کس چیز سے متعین ہوتا ہے؟

    • A.Semicolonsسیمیکولنز (Semicolons)
    • B.Curly bracesکرلی بریسز (Curly Braces)
    • C.Indentation (correct answer)انڈنٹیشن (Indentation)
    • D.Round bracketsگول بریکٹس (Round Brackets)
    Why: Indentation defines the structure, block, or scope of Python code.انڈنٹیشن Python کوڈ کی ساخت، بلاک یا دائرے کو متعین کرتی ہے۔
  14. 14

    What error may occur if the indentation in Python code is incorrect?

    اگر Python کوڈ میں انڈنٹیشن غلط ہو تو کون سی ایرر آ سکتی ہے؟

    • A.IndentationError (correct answer)
    • B.SyntaxWarning
    • C.NameError
    • D.TypeError
    Why: Incorrect indentation may cause an IndentationError in Python.غلط انڈنٹیشن Python میں IndentationError کا سبب بن سکتی ہے۔
  15. 15

    Is proper indentation mandatory in Python?

    کیا Python میں مناسب انڈنٹیشن لازمی ہے؟

    • A.No, it is optionalنہیں، یہ اختیاری ہے
    • B.Only inside functionsصرف فنکشنز کے اندر
    • C.Only inside loopsصرف لوپس کے اندر
    • D.Yes, proper indentation is mandatory (correct answer)ہاں، مناسب انڈنٹیشن لازمی ہے
    Why: Proper indentation is mandatory in Python, and incorrect indentation may cause an error.Python میں مناسب انڈنٹیشن لازمی ہے اور غلط انڈنٹیشن ایرر کا سبب بن سکتی ہے۔
  16. 16

    What does this code print? temperature = 35; if temperature > 30: print("It's a hot day")

    یہ کوڈ کیا پرنٹ کرتا ہے؟ temperature = 35; if temperature > 30: print("It's a hot day")

    • A.It's not a hot dayگرم دن نہیں ہے
    • B.It's a hot day (correct answer)گرم دن ہے
    • C.temperature > 30
    • D.Nothing is printedکچھ بھی پرنٹ نہیں ہوتا
    Why: Since 35 is greater than 30, the if block runs and prints "It's a hot day".چونکہ 35، 30 سے بڑا ہے، اس لیے if بلاک چلتا ہے اور «گرم دن ہے» پرنٹ ہوتا ہے۔
  17. 17

    In the syntax of an if statement, what must come after the condition?

    if اسٹیٹمنٹ کی ترکیب (Syntax) میں شرط کے بعد کیا آنا ضروری ہے؟

    • A.A semicolonسیمیکولن
    • B.A commaکوما (Comma)
    • C.A colon (correct answer)کولن (Colon)
    • D.A full stopفل اسٹاپ (Full Stop)
    Why: The syntax of an if statement ends the condition line with a colon.if اسٹیٹمنٹ کی ترکیب میں شرط والی لائن کولن پر ختم ہوتی ہے۔
  18. 18

    What does an if-else statement allow a program to do?

    if-else اسٹیٹمنٹ (if-else Statement) پروگرام کو کیا کرنے کی اجازت دیتا ہے؟

    • A.Execute both blocks in every caseہر صورت میں دونوں بلاکس چلانا
    • B.Skip both blocksدونوں بلاکس کو چھوڑ دینا
    • C.Loop foreverہمیشہ کے لیے لوپ چلانا
    • D.Execute one block if a condition is true and another block if it is false (correct answer)شرط درست ہونے پر ایک بلاک چلانا اور شرط غلط ہونے پر دوسرا بلاک چلانا
    Why: An if-else statement runs one block when the condition is true and another block when it is false.if-else اسٹیٹمنٹ شرط درست ہونے پر ایک بلاک اور شرط غلط ہونے پر دوسرا بلاک چلاتا ہے۔
  19. 19

    What does this code print? temperature = 15; if temperature > 30: print("It's a hot day") else: print("It's not a hot day")

    یہ کوڈ کیا پرنٹ کرتا ہے؟ temperature = 15; if temperature > 30: print("It's a hot day") else: print("It's not a hot day")

    • A.It's not a hot day (correct answer)گرم دن نہیں ہے
    • B.It's a hot dayگرم دن ہے
    • C.temperature is 15درجہ حرارت 15 ہے
    • D.No output is producedکوئی آؤٹ پٹ پیدا نہیں ہوتا
    Why: Since 15 is not greater than 30, the else block runs and prints "It's not a hot day".چونکہ 15، 30 سے بڑا نہیں ہے، اس لیے else بلاک چلتا ہے اور «گرم دن نہیں ہے» پرنٹ ہوتا ہے۔
  20. 20

    Which statement is used to execute code when a condition is false?

    شرط غلط ہونے پر کوڈ چلانے کے لیے کون سا اسٹیٹمنٹ استعمال ہوتا ہے؟

    • A.if
    • B.while
    • C.else (correct answer)
    • D.for
    Why: The else statement runs its code block when the condition is false.else اسٹیٹمنٹ شرط غلط ہونے پر اپنا کوڈ بلاک چلاتا ہے۔
← All chapters of Computer Science