comp sci quizziz
logical operators
"and, or and not" are ___________________
'cdef'
alpha = 'abcdef' alpha[2:]
"hello"
word = "hello" print(word) The result will be ___________
"h"
word = "hello" word[0] What is the output of the code above?
true
x = 5 print(x > 3 and x < 10)
30
x = 5 y = 6 print(x*y) The code above displays the following:
print ("Hello!")
How would would you print a text string?
/, *, +, -
Operators used in python: divide, multiply, add, subtract
Text-based programming language
Python is an example of a....
'l'
Run the code below word = "hello" word[3]
value
The number or word we give to a variable
F5
What button do you press to compile (run) your program so that it runs in the shell?
\n
What code do you use to move a sentence or words to another line?
\t
What code is used to create space between words or sentences,. tab space?
print("")
What function is used to output a message in python?
A function that allows us to ask the user to enter some data.
What is a input?
A box(memory location) where you store values
What is a variable?
Python
What is the name of the programming language we are learning?
What is the word (command) used to display numbers and text on the screen?
equals =
What symbol is used in python to assign values to a variable?
10
What will be the output when a=4 , b=3 , c=3 a+=b+c
Dave
What will be the output? name = 'Dave' print (name)
26
What would print (10 + 16) produce?
input()
Which function accepts all data as string or characters but not as numbers?
=
Which is known as simple assignment operator?
blue and yellow
Which is the Python logo color?
duple
Which of the following datatypes are considered as numbers in python-
'abc'
alpha = 'abcdef' alpha[0:3]
'abcd'
alpha = 'abcdef' alpha[0:4]
'ace'
alpha = 'abcdef' alpha[0:6:2]
'cd'
alpha = 'abcdef' alpha[2:4]
3.7
print((15%4))
8
print(2**3)
3
print(7//2)
true
print(9>2 and 6<=6)