Python Skill Assessment

Written by Coursera • Updated on

Test your Python skills with this quick assessment. Answer 10 multiple-choice questions to get your score, then check the Scoring Guide to find your level and recommended learning path.

Python Skill Assessment

Python Programming Quiz

1. What will be the output of print(type([1, 2, 3]))?

list
array
<class 'list'>
type: list

2. Which of these is a valid way to create a dictionary?

dict(a=1, b=2)
{'a': 1, 'b': 2}
dict([('a',1), ('b',2)])
All of the above

3. What is the difference between list.append() and list.extend()?

No difference
append() adds one element, extend() adds multiple elements
append() adds elements to the start, extend() adds to the end
append() works with lists only, extend() works with any type

4. What is a decorator in Python?

A function that adds CSS styling
A design pattern for classes
A function that takes another function as input and extends its behavior
A way to comment code

5. What does this code output?

x = [1, 2, 3]
y = x
y.append(4)
print(x)
[1, 2, 3]
[1, 2, 3, 4]
[4]
Error

6. What is the purpose of the __init__ method in a class?

To initialize class variables
To create a new instance of the class
To define the constructor of the class
To import required modules

7. What is a generator in Python?

A function that generates random numbers
A function that yields values one at a time instead of returning all at once
A class that creates new instances
A tool for creating new functions

8. Which statement about Python's GIL is correct?

It allows multiple threads to execute Python code simultaneously
It prevents multiple threads from executing Python code simultaneously
It is used for garbage collection
It manages database connections

9. What is the correct way to handle exceptions?

try:
    x = 1/0
except:
except Exception:
except ZeroDivisionError:
Both B and C are correct

10. What is the output of this list comprehension?

[x**2 for x in range(5) if x % 2 == 0]
[0, 2, 4]
[0, 4, 16]
[0, 1, 4, 9, 16]
[0, 4]

Scoring Guide & Course Recommendations

0-30: Beginner Level

40-70: Intermediate Level

80-100: Advanced Level

Skills Covered by Level

Beginner Level

  • Basic syntax

  • Variables and data types

  • Control structures (if/else, loops)

  • Basic functions

  • Lists and dictionaries

  • File I/O

Intermediate Level

  • Object-oriented programming

  • Error handling

  • Regular expressions

  • Web APIs

  • Database connections

  • Basic libraries (NumPy, Pandas)

Advanced Level

  • Design patterns

  • Generators and decorators

  • Multithreading/multiprocessing

  • Memory management

  • Performance optimization

  • Advanced frameworks

Career Paths

Updated on
Written by:

Coursera

Writer

Coursera is the global online learning platform that offers anyone, anywhere access to online course...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.