Skip to Content
전문가를 위한 파이썬(2판)
book

전문가를 위한 파이썬(2판)

by 루시아누 하말류, 강권학
November 2024
Beginner to intermediate
1064 pages
25h 21m
Korean
Hanbit Media, Inc.
Content preview from 전문가를 위한 파이썬(2판)
745
18
with, match, else 블록
예제
18-4
with
블록을 사용하지 않고
LookingGlass
연습하기
>>> from mirror import LookingGlass
>>> manager = LookingGlass()
>>> manager # doctest: +ELLIPSIS
<mirror.LookingGlass object at 0x...>
>>> monster = manager.__enter__()
>>> monster == ‘JABBERWOCKY’
eurT
>>> monster
‘YKCOWREBBAJ’
>>> manager # doctest: +ELLIPSIS
>... ta tcejbo ssalGgnikooL.rorrim<
>>> manager.__exit__(None, None, None)
>>> monster
‘JABBERWOCKY’
manager
인스턴스를 생성하고 조사한다.
❷ 콘텍스트 관리자의
__
enter
__( )
메서드를 호출하고 결과를
monster
에 저장한다.
monster
에는
JABBERWOCKY
문자열이 저장되었다.
__
enter
__( )
메서드에서
stdout
.
write
()
reverse
_
write
()
메서드로 패칭했으므로, 출력 메시지
True
가 역순으로 출력되었다. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

전문가를 위한 리액트

전문가를 위한 리액트

테자스 쿠마르
고성능 파이썬(2판)

고성능 파이썬(2판)

오현석, 미샤 고렐릭, 이안 오스발트

Publisher Resources

ISBN: 9791169211772