list comprehension 주의할점

Yeeun·2025년 6월 18일

Python

목록 보기
31/31

How List Comprehensions Work

A list comprehension like [expression for item in iterable] does two things:

It evaluates expression for each item in iterable.

It collects the result of each evaluation into a new list.

What Does print() Return?

The print() function in Python prints to the screen, but it does not return any useful value. Instead, it always returns None

For each item in analysisquestions, print() is called: this prints the item to the screen.

After printing, print(_) returns None.

The list comprehension collects each of these None return values into a list.


0개의 댓글