
Tce Code War

Quiz
•
Engineering
•
University
•
Hard
Neela G
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the code ?
def f(x, y=[]):
y.append(x)
return y
print(f(1))
print(f(2))
[1] [2]
[1] [1, 2]
[1, 2] [2]
Error
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the code?
x = [1, 2, 3]
y = x[:]
y[0] = 99
print(x[0], y[0])
1 99
99 1
99 99
Error
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of code ?
def func(a, b=2, c=3):
print(a, b, c)
func(5, c=10)
5 2 10
5 2 3
5 2 5
error
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the code below?
a = [1, 2, 3]
print(a * 2)
[1, 2, 3, 1, 2, 3]
[2, 4, 6]
[1, 2, 3, 2]
Error
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Choose the output for the code below
print([i for i in range(3)])
print((i for i in range(3)))
[0, 1, 2] [0, 1, 2]
0 1 2
[0, 1, 2] <generator object>
[1 2]
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
x = [1, 2, 3]
print(x is x[:])
True
False
Error
1 2 3
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Choose the output for the code
a = ([])
for i in range(3):
a.append(i)
print(a)
[1 2 3]
[0 1]
[0, 1, 2]
0 1 2
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Hackharbor 3.0 Day 4:Tech

Quiz
•
University
20 questions
python quiz1

Quiz
•
University
10 questions
Post Quiz on PID Controllers

Quiz
•
University
10 questions
wp_js

Quiz
•
University
10 questions
Snap! Listas

Quiz
•
University
10 questions
Fundamentos de Python

Quiz
•
University
10 questions
quiz

Quiz
•
University
18 questions
Module 13g Pitot Static

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Engineering
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University