Complete Questions and Correct
Answers | Verified Answers | Just
Released
What is the output of the following code?
all = [4, 3, 2, 8, 7, 5, 3, 1, 3]
print(all.count(3))
print(all.count(9)) ---------CORRECT ANSWER-----------------3
0
What's the output of the following program?
t1 = (1, 2)
t2 = (3, 4)
print(t1 + t2) ---------CORRECT ANSWER-----------------(1, 2, 3, 4)
Which of the following best describe the following code?
ta = (1, 2, 3, 4)
ta.append(5)
print(ta) ---------CORRECT ANSWER-----------------There is an error on line 2.
,Which of the following is not a valid escape sequence? ---------CORRECT ANSWER--
---------------\%
Which of the following represents a newline character? ---------CORRECT ANSWER-
----------------\n
Which of the following statement produces the following output?
You can't beat them all. ---------CORRECT ANSWER-----------------print('You can\'t
beat them all.')
print("You can't beat them all.")
What is the value of len('It\'s')? ---------CORRECT ANSWER-----------------4
What is the output of the following code?
str1 = "Python is fun"
res = str1 [-3:-1]
print (res) ---------CORRECT ANSWER-----------------fu
,What is the output of the following code?
str1 = "Python is fun"
res = str1[-1]
print(res) ---------CORRECT ANSWER-----------------n
What's the value of res after the following code?
str1 = "What is fun?"
res = str1[1:1] ---------CORRECT ANSWER-----------------""
Strings are immutable. This means that once defined, they cannot be modified. ---
------CORRECT ANSWER-----------------true
Given the following code:
string1 = "hi"
string2 = "hi"
which of the following statements about string1 and string2 are true? ---------
CORRECT ANSWER-----------------The values of both strings are the same.
The values of the id function of both strings are the same.
, How many lines of output does the following program produce?
s = "Coding in Python is fun."
for ch in s[3:8]:
print("Hi") ---------CORRECT ANSWER-----------------5
How many times the letters i and s were printed in the following code? Only
count letters i and s.
string1 = "Mississippi"
for index in range(len(string1)):
if index % 2 != 0:
print(string1[index]) ---------CORRECT ANSWER-----------------4
What's the output of the following code?
st = "joe doe"
index = 1
while (index < len(st)):
print(st[index])
index = index + 2 ---------CORRECT ANSWER-----------------o
o
Which of the following refer to the last element in a list names? Check all that
apply. ---------CORRECT ANSWER-----------------names[-1]