Python Quiz
20 Questions
60 Views

Python Quiz

Created by
@ResourcefulCoralReef

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of a Nested IF Statement?

  • To check a single condition
  • To check multiple possibilities (correct)
  • To store user input
  • To perform arithmetic operations
  • What is the data type of the variable 'forename' in the Tracking Assessment task?

  • Float
  • String (correct)
  • Integer
  • Boolean
  • What is the operator used to assign a value to a variable?

  • ==
  • = (correct)
  • ===
  • !=
  • What type of control structure is used to check if the username and password are correct?

    <p>IF Statement</p> Signup and view all the answers

    What is the purpose of the variable 'average_score' in the Tracking Assessment task?

    <p>To store the average exam score</p> Signup and view all the answers

    What is the purpose of a variable in Python?

    <p>To store and manage data</p> Signup and view all the answers

    What data type would the number 3.14 be classified as in Python?

    <p>Float</p> Signup and view all the answers

    How can you get user input and store it as a variable in Python?

    <p>Using an input function</p> Signup and view all the answers

    What is the purpose of the code print('I am a Year 10 student studying ICT at ' + school)?

    <p>To display a message to the user using variables</p> Signup and view all the answers

    What is the difference between an integer and a float in Python?

    <p>Integers are whole numbers, while floats are numbers with decimals</p> Signup and view all the answers

    What is a correct syntax to output "Hello World" in Python?

    <p>print &quot;Hello World&quot;</p> Signup and view all the answers

    Which one is NOT a legal variable name?

    <p>_myvar</p> Signup and view all the answers

    How do you create a variable with the numeric value 5?

    <p>Both are Correct</p> Signup and view all the answers

    In Python, 'Hello', is the same as "Hello"

    <p>True</p> Signup and view all the answers

    Which operator is used to multiply numbers?

    <ul> <li></li> </ul> Signup and view all the answers

    In an IF statement, which operator can be used to compare two values?

    <p>==</p> Signup and view all the answers

    Match the operators

    <p>Add = + Divide = / multiply = * Subtract = -</p> Signup and view all the answers

    Match the correct data types:

    <p>135 = Integer 22.2 = Float 32 Donard Road = String Spaces used to organise blocks of code = Indetentation</p> Signup and view all the answers

    What will this code show:

    <p>Code B</p> Signup and view all the answers

    An error occurs when Mr McGee runs this code. What is the issue?

    <p>Variable 'name' doesn't exist</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser