Python Quiz
20 Questions
65 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

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 (B)</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 (C)</p> Signup and view all the answers

What is the purpose of a variable in Python?

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

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

<p>Float (B)</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 (A)</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 (C)</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 (B)</p> Signup and view all the answers

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

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

Which one is NOT a legal variable name?

<p>_myvar (A)</p> Signup and view all the answers

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

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

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

<p>True (A)</p> Signup and view all the answers

Which operator is used to multiply numbers?

<ul> <li>(A)</li> </ul> Signup and view all the answers

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

<p>== (A)</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 (D)</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 (B)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser