placeholder image to represent content

Y12: Strings, int, float, user inputs

Quiz by Teran Subasinghe

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    Which function is used in Python to take input from the user?
    input()
    get()
    read()
    scan()
    30s
  • Q2
    How can you convert a string '123' into an integer in Python?
    num('123')
    float('123')
    int('123')
    str('123')
    30s
  • Q3
    What will the output of the following code be: print('A' * 3)?
    AAA
    A A A
    Error
    AA
    30s
  • Q4
    What will happen if you try to concatenate a string and an integer in Python, such as 'Age: ' + 5?
    TypeError
    It will ignore the integer
    It will convert 5 to a string
    It will print 'Age: 5'
    30s
  • Q5
    Given the input 'hello', how would you convert it to uppercase in Python?
    'hello'.toUpperCase()
    'hello'.capitalize()
    'hello'.upper()
    'hello'.uppercase()
    30s
  • Q6
    What will the result of the expression '3' + '2' be in Python?
    5
    '32'
    23
    6
    30s
  • Q7
    What is the output of the following code: print(5 + 3.2)?
    53.2
    8.0
    8
    8.2
    30s
  • Q8
    What will be the output of the following code: print(int('10') + 5)?
    105
    5
    10
    15
    30s
  • Q9
    What will happen if you try to execute the code: print('Hello' + 2)?
    TypeError
    Hello
    Hello2
    2
    30s
  • Q10
    What is the result of the expression float('3.14') + int('2')?
    5
    5.14
    6
    3.14
    30s
  • Q11
    What is the output of the following code: print(str(100) + ' apples')?
    '100 apples'
    100
    TypeError
    100 apples
    30s
  • Q12
    What will be the result of attempting to print: print('The answer is ' + 42)?
    The answer is 42.0
    TypeError
    The answer is 42
    None
    30s
  • Q13
    What is the result of the expression: print(int('5.5'))?
    ValueError
    5.0
    5.5
    5
    30s
  • Q14
    What will the expression '100' * 3 evaluate to in Python?
    '100100100'
    300.0
    TypeError
    300
    30s
  • Q15
    What will be the output of the expression: print('Value: ' + str(7.5))?
    TypeError
    Value: 7
    'Value: 7.5'
    Value: 7.5.0
    30s

Teachers give this quiz to your class