Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
287 views

1-Python Input, Output, Variables and Operators - Print - Quizizz

This document is a 120 question quiz about Python input, output, variables, and operators. It covers topics like: - What a variable is and how to assign it a value - Different data types like strings, integers, floats, and booleans - The print function and how it displays output - Basic arithmetic, comparison, and logical operators - Taking user input with the input function - Converting between different data types The quiz contains multiple choice questions to test understanding of Python fundamentals like printing, variables, data types, operators, and taking user input.

Uploaded by

Vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
287 views

1-Python Input, Output, Variables and Operators - Print - Quizizz

This document is a 120 question quiz about Python input, output, variables, and operators. It covers topics like: - What a variable is and how to assign it a value - Different data types like strings, integers, floats, and booleans - The print function and how it displays output - Basic arithmetic, comparison, and logical operators - Taking user input with the input function - Converting between different data types The quiz contains multiple choice questions to test understanding of Python fundamentals like printing, variables, data types, operators, and taking user input.

Uploaded by

Vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

NAME :

CLASS :
Python Input, Output, Variables and Operators
DATE :
120 Questions

1. Which of these stores a piece of data, and gives it a specific


name?

a) variable b) whitespace
c) interpreter d) modulo

2. Which data type than can have one of two values: True or
False?

a) boolean b) variable
c) modulo d) interpreter

3. Which example is the correct way to write a variable in Python


and and assign it a value?

a) my_variable = 10 b) my variable = 10

c) my_variable is 10 d) my_variable: 10

4. Which data type can store numbers, letters and symbols?

a) String b) Integer

c) Float d) Boolean

5. Which data type is the most suitable to store a whole number?

a) String b) Integer

c) Boolean d) Float

6. What does the print function do in python?

a) It's a variable. b) It can input data.

c) It displays something like a string or integer d) It loops the code.

7. What will the output be from the following code?


print("Hello world!")

a) SyntaxError b) Hello world!

c) "Hello world!" d) print(Hello world!)

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 1/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

8. What will the output be from the following code?


print(3+4)

a) 3+4 b) 7

c) SyntaxError d) print(3+4)

9. print("12"*3)What would this print?

a) 36 b) 121212
c) 24 d) 12*3

10. What will the output be from the following code?


print("3+4")

a) 7 b) 3+4

c) 34 d) SyntaxError

11. What will the output be from the following code?


print("Hello" + "world" + "today")
a) Helloworldtoday b) Hello world today

c) "Hello" "world" "today" d) SyntaxError

12. What will the output be from the following code?


print("Hello world!\nHello world!")

a) Hello world! Hello world! b) Hello world!


Hello world!

c) SyntaxError d) Hello world!

13. Which function takes a users input

a) print() b) int()
c) input() d) def

14. Which is the most appropriate data type for: "13th December"

a) Float b) Boolean

c) Integer d) String

15. What is the word (command) used to display numbers and text
on the screen?
a) print b) input

c) output d) command

16. What symbol is used in python to assign values to a variable?

a) equals = b) plus +

c) two equal signs == d) asterisk *

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 2/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

17. What will be the output?


name = 'Dave'
print (name)

a) Dave b) 'Dave'

c) name d) (name)

18. What would print (10 + 16) produce?

a) 20 b) 22

c) 24 d) 26

19. What is the answer to print (12/6)?

a) 1 b) 2

c) 6 d) 10

20. How do you display text?

a) input b) output

c) print d) variable

21. Variables cannot be changed.

a) False b) True

22. Constants cannot be changed.

a) True b) False

23. Variable names can't start with a number.

a) True b) False

24. 5.23 would be stored as:

a) Integer b) Real Number


c) String d) Character

e) Boolean

25. Comparison Operators


What is >= ?

a) Greater than b) Less than


c) Greater than or equal to d) Less than or equal to

26. Comparison Operators


What is < ?

a) Greater than b) Less than


c) Greater than or equal to d) Less than or equal to

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 3/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

27. Comparison OperatorsWhat is A > B?

a) A greater than B b) A less than B


c) Greater than or equal to d) Less than or equal to

28. Comparison Operator


What is <= ?

a) Greater than b) Less than


c) Greater than or equal to d) Less than or equal to

29. Logical Operators


What is && ?
a) And b) Or

c) Not d) Less than

30. Comparison Operators


What is != ?
a) Equal to b) Equal value and equal type

c) Not equal d) Not equal value or not equal type

31. Comparision Operators


What is == ?
a) Equal to b) Equal value and equal type
c) Not equal d) Not equal value or not equal type

32. Arithmetic Operators


What is a / ?

a) Addition b) Subtraction
c) Division d) Modulo

33. 5 would be stored as:

a) Integer b) Real Number

c) String d) Character
e) Boolean

34. M / F would be stored as:

a) Integer b) Real Number


c) String d) Character

e) Boolean

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 4/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

35. "The cat sat on the mat" would be stored as:

a) Integer b) Real Number

c) String d) Character
e) Boolean

36. Conversion of one data type to another e.g. age = "30" # this is
a string!YearsOld=int(age)
is known as...?

a) Declaring b) Assigning (or Assignment)


c) Casting d) Concatenation

37. Which of the following is a command to have a message


appear on the screen?

a) print b) write
c) msg d) input

38. Which of the following is used in Python to give a value to a


variable

a) := b) ==
c) =

39. What will the output be from the following code?


print(Hello world!)

a) Hello world! b) SyntaxError


c) Hello world d) print(Hello world!)

40. Why do we put a string of text inside the brackets of an input?

a) The input function can also be used as an b) The input function can also be used as an
output, but only one string at a time. output, with several strings at a time.
c) The string of text can be used to instruct the d) The string of text is required, to act as a
user as to what they must type in. wrapper for the input the user types in;
otherwise the data will be invalid string data
and go nowhere.

41. What is a variable?

a) A named block of memory, used whilst a b) A named block of memory, where the results
program is running to store data. of a program get stored once it has been
closed down.

c) A block of computer memory that gets d) A process within the cpu, that is given a
permanently named after the variable, even specific name by the program, so it is easier
when the program is closed down. to identify.

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 5/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

42. What will be the output?name = 'Fred'print (name)

a) Fred b) 'Fred'

c) name d) (name)

43. What is the answer to print (16//5)?

a) 1 b) 3
c) 21 d) 165

44. What is the purpose of comment lines in code?


a) To compliment your work so you feel better b) To explain the code that follows it.
about it.

c) To make the code compile. d) To make your code longer so you get more
points.

45. Returns the remainder from division.

a) boolean b) modulus

c) variables d) exponents

What will be the output from the following code?


46.
print(17%5)

a) 3 b) 3.4
c) 2 d) 12

47. What is the assignment operator?

a) += b) =

c) -> d) ==

48. What will the output be from the following code?


print("3*4+5")

a) SyntaxErrror b) 17
c) 3*4+5 d) 12

49. What will the output be from the following code?


print(3*4+5)

a) SyntaxErrror b) 17

c) 3*4+5 d) 12

50. Operators used in python:


divide, multiply, add, subtract

a) /, *, +, - b) div, mul, +, -
c) \, x, +, - d) ~, *, +, -

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 6/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

51. Which of the following functions is used to get information from


the user of a program?

a) input() b) print()
c) import d) eval()

52. >=

a) greater than b) greater than or equal to

c) not greater than d) not equal to

53. 2 == 3

a) TRUE b) FALSE

54. Which one is not a Equality or Relational Operator

a) == b) !=
c) =< d) >=

55. What is the assignment operator (symbol) in the following


code.
message = input("Enter message: ")

a) ( b) )

c) " d) =

56. What is the difference between these two lines of code


1 print("name")
2 print(name)

a) One will print " " marks and the other will not b) One prints the word name, and the other
prints whatever is assigned the name
variable
c) One prints out name, the other gets input and d) There is no difference, they both do the same
stores it in name thing

57. What happens if you run the following code?

foo = "a string"

a) foo and "a string" are printed b) "a string" is added onto to the end of foo

c) The value "a string" is stored in the variable d) The user is asked to enter "foo" into the
foo console

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 7/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

58. python was founded by ________

a) b) Torvald

c) Guido Van d) All

59. identify python membership operators.

a) in, not in b) is , is not

c) in, in not d) is not, is

60. how many keywords did python 3.7 consist of

a) 32 b) 30
c) 31 d) 33

61. a= 63a<<2what is output for bit-wise left-shift

a) 230 b) 243

c) 250 d) 252

62. identify valid identifiers (variable or variables)

a) a123 b) _n

c) 1a d) n%4

e) n 9

63. identify the applications where python can be used

a) Web Applications b) Software Development


c) 3D CAD Applications d) Enterprise Applications

e) all the above

64. identify bulit-in module( or s)

a) os b) math

c) random d) statistics
e) sys

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 8/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

65. identify python Data structures

a) list b) tuple

c) dict d) set

e) All the mentioned

66. Python provides _______ function to returns type of the


variable passed.

a) type() b) typeof()

c) both a and b d) non

67. what is the buit-in module one should import to work on regex

a) regular expression b) re

c) regex d) all the above

68. identify python multi-line comments

a) """""" b) ''''''

c) both a and b d) =begin=cut

69. is python supports do-while loop?

a) no b) yes

70. #output of the following codei =1 while(i<5): print(i,end="")


i=i+1

a) 1234 b) 1234

c) 12345 d) 1245

71. what is the keyword used to declare a function name in


python?

a) sub b) function

c) fun d) def

72. num = int(input("enter any number:"))#what int denotes from


above statment

a) interger b) float
c) character d) double

73. what is the built-in function used to sort the given list of
elements in python

a) sort b) sorted

c) merge d) srt

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 9/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

74. Which data type is used to store:


100

a) Integer b) Double

c) Boolean d) String

75. Which data type is used to store:


TRUE
a) Boolean b) Double

c) String d) Integer

76. Which data type is used to store:


"D"

a) Character b) String
c) Integer d) Double

77. This data type is used to store whole numbers


a) Integer b) Double

c) Boolean d) String

78. This data type is used to store a mixture of letters and


numbers and symbols.

a) String b) Character
c) Boolean d) Integer

79. What is a variable?

a) A storage location of memory which can b) A random area to store things in.
change

c) Something that changes d) Something that can only store numbers

80. What is a Constant?

a) A storage location of memory which does not b) A random area to store things in.
change
c) Something that changes d) Something that can only store numbers

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 10/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

81. Which variable uses a integer data type?

a) password b) passwordScore
c) passwordLength

82. Which variable uses a string data type?

a) password b) passwordScore

c) passwordLength

83. What is python?

a) a programming language b) DTP software


c) Spreadsheet software d) Computer

84. What extension must you add to the end of a file when saving?

a) .xlsx b) .pptx

c) .docx d) .py

85. What syntax can you use to insert a line break between strings
so that they appear over multiple lines?

a) / b) \n
c) \l d) n

86. A variable is a named value that can be changed in the


program.

a) False b) True

87. What is a String?

a) A data type that contains whole numbers. eg: b) Numbers with decimal point. eg: 0.5, 2.45,
3, 45, 124 56.04

c) Group of characters between quotation d) Data type that can only be True or False.
marks. eg: "dog"

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 11/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

88. Which value is a String?

a) 64 b) "cat"

c) True d) 0.5

89. What is an Integer?

a) A data type that contains whole numbers. eg: b) Numbers with decimal point. eg: 0.5, 2.45,
3, 45, 124 56.04

c) Group of characters between quotation d) Data type that can only be True or False.
marks. eg: "dog"

90. Which value is an Integer?

a) 64 b) "cat"

c) True d) 0.5

91. What is a Float?

a) A data type that contains whole numbers. eg: b) Numbers with decimal point. eg: 0.5, 2.45,
3, 45, 124 56.04

c) Group of characters between quotation d) Data type that can only be True or False.
marks. eg: "dog"

92. Which value is a Float?

a) 64 b) "cat"

c) True d) 0.5

93. What is a Boolean?

a) A data type that contains whole numbers. eg: b) Numbers with decimal point. eg: 0.5, 2.45,
3, 45, 124 56.04

c) Group of characters between quotation d) Data type that can only be True or False.
marks. eg: "dog"

94. Which value is a Boolean?

a) 64 b) "cat"

c) True d) 0.5

95. Which writes a message for the user?

a) input() b) myVar="Hi"

c) print("Hello!") d) max=100

96. Which of the following statement is correct?

a) Python is a high level programming language b) Python is an low level programming language

c) Python is an machine code language d) All of the above

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 12/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

Which data type represents a whole number?


97.
a) integer

b) string c) float
d) Boolean

98. What data type is a in this code : a = "5"


a) integer b) float

c) boolean d) string

99. What command do we use to tell Python to accept an input?

a) cin b) input()

c) scanf() d) <>

100. What does the statement 'print' do?

a) Output a hard copy of a program to a printer b) Output a message on the screen

c) Print a hard copy of a flowchart to a computer

101. What is a variable?

a) A number b) A message input by the user

c) A location in memory that we use to store


data

102. Which of the following is correct?

a) The Python interpreter ignores comments b) Comments are used by programmers for a
better understanding of the program

c) You use the # symbol before a comment d) All of the above

103. A programmer types flt(price), what type of data are they


assigning to the price?

a) Boolean b) Float
c) String d) Integer

104. The correct way to write a variable in Python?


a) my_variable = 10 b) my variable = 10

c) my_variable is 10 d) my_variable: 10

105. 102 = 100


Which of the following is used in Python to calculate ten
squared?

a) 10 ** 2 b) 10 * 2

c) 10 % 2 d) 10 ** 10

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 13/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

106. Used to make comments

a) # b) %

c) ** d) ()

107. symbol used for modulo

a) % b) &
c) # d) **

108. surrounds multi-line comments


a) """ b) **

c) # d) %

109. Choose the correct Python code.


if age is less than 20 and greater than equal or equal to 15
then

a) if age <20 and age >=15: b) if age <20>=15 :

110. What is the output of the following code :


print 9//2

a) 4.5 b) 4.0

c) 4 d) 3

111. What is the answer of this expression, 22 % 3 is?

a) 7 b) 1

c) 0 d) 5

112. x = 4.5y = 2print(x//y)

a) 2.0 b) 2

c) 9 d) 9.0

113. x = 5
print(x > 3 and x < 10)

a) True b) False

114. x = 8
print(x > 3 or x < 20)

a) True b) False

115. x = 5
print(not(x > 3 or x < 2))

a) True b) False

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 14/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

116. x = 5y = 3
print(x == y)

a) True b) False

117. x = "5"y = 5
print(x == y)

a) True b) False

118. x = 10y = 10
print(x != y)

a) True b) False

119. x = 5
x%=3
print(x)

a) 2 b) 2.0
c) 3 d) 3.0

120. Everything that we want do display in a print() function must:

a) be inside parentheses - () b) quotation marks - ""

c) be inside single quotation marks - '' d) be inside hash marks - #

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 15/16
2/14/2020 Python Input, Output, Variables and Operators | Print - Quizizz

Answer Key
1. a 31. a 61. d 91. b
2. a 32. c 62. a,b 92. d
3. a 33. a,d 63. e 93. d
4. a 34. e 64. a,b,c,d,e 94. c
5. b 35. c 65. e 95. c
6. c 36. c 66. a 96. a
7. b 37. a 67. b 97. a
8. b 38. c 68. c 98. d
9. b 39. b 69. a 99. b
10. b 40. c 70. a 100. b
11. a 41. a 71. d 101. c
12. b 42. a 72. a 102. d
13. c 43. b 73. b 103. b
14. d 44. b 74. a 104. a
15. a 45. b 75. a 105. a
16. a 46. c 76. a 106. a
17. a 47. b 77. a 107. a
18. d 48. c 78. a 108. a
19. b 49. b 79. a 109. a
20. c 50. a 80. a 110. c
21. a 51. a 81. b 111. b
22. a 52. b 82. a 112. b
23. a 53. b 83. a 113. a
24. b 54. c 84. d 114. a
25. c 55. d 85. b 115. b
26. b 56. b 86. b 116. b
27. a 57. c 87. c 117. b
28. d 58. c 88. b 118. b
29. a 59. a 89. a 119. a
30. c 60. d 90. a 120. b

https://quizizz.com/print/quiz/5dd7b569d7ff37001bd90e94 16/16

You might also like