Y12: Strings, int, float, user inputs
Quiz by Teran Subasinghe
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
15 questions
Show answers
- Q1Which function is used in Python to take input from the user?input()get()read()scan()30s
- Q2How can you convert a string '123' into an integer in Python?num('123')float('123')int('123')str('123')30s
- Q3What will the output of the following code be: print('A' * 3)?AAAA A AErrorAA30s
- Q4What will happen if you try to concatenate a string and an integer in Python, such as 'Age: ' + 5?TypeErrorIt will ignore the integerIt will convert 5 to a stringIt will print 'Age: 5'30s
- Q5Given the input 'hello', how would you convert it to uppercase in Python?'hello'.toUpperCase()'hello'.capitalize()'hello'.upper()'hello'.uppercase()30s
- Q6What will the result of the expression '3' + '2' be in Python?5'32'23630s
- Q7What is the output of the following code: print(5 + 3.2)?53.28.088.230s
- Q8What will be the output of the following code: print(int('10') + 5)?1055101530s
- Q9What will happen if you try to execute the code: print('Hello' + 2)?TypeErrorHelloHello2230s
- Q10What is the result of the expression float('3.14') + int('2')?55.1463.1430s
- Q11What is the output of the following code: print(str(100) + ' apples')?'100 apples'100TypeError100 apples30s
- Q12What will be the result of attempting to print: print('The answer is ' + 42)?The answer is 42.0TypeErrorThe answer is 42None30s
- Q13What is the result of the expression: print(int('5.5'))?ValueError5.05.5530s
- Q14What will the expression '100' * 3 evaluate to in Python?'100100100'300.0TypeError30030s
- Q15What will be the output of the expression: print('Value: ' + str(7.5))?TypeErrorValue: 7'Value: 7.5'Value: 7.5.030s