Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111095

How well do you know Python?

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject How well do you know Python?
Date 2016-07-05 14:02 +1000
Message-ID <mailman.83.1467691359.2295.python-list@python.org> (permalink)
References <CAPTjJmoZobGYDh8jWDPPWQqoN-gid+-HUp9-dtKX_Vp=BgHc+w@mail.gmail.com>

Show all headers | View raw


After some discussion with a Ruby on Rails programmer about where Ruby
ends and where Rails begins (and it's definitely not where I'd have
expected... Rails does a ton of monkey-patching, including of built-in
types, to provide functionality that is strangely absent from the core
language), I tried to come up with some somewhat-challenging Python
questions. But to make them hard, I had to go a smidge more esoteric
than the Ruby questions did.... Anyhow, see how you go. Assume Python
3.x unless stated.

1) Under what circumstances can str.upper() return a string of
different length to its input?
2) What exception do you get when you craft an impossible class hierarchy?
    a. ValueError b. TypeError c. types.ClassInheritanceError d. SyntaxError
3) What does `from __future__ import braces` do?
4) Which operator, removed from Python 3.0, can be reinstated with a
'joke' future directive?
5) What is the difference between the `/` and `//` operators in Python
2.7? In Python 3.x?

Got any other tricky questions to add?

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

How well do you know Python? Chris Angelico <rosuav@gmail.com> - 2016-07-05 14:02 +1000
  Re: How well do you know Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-05 16:05 +1000
  Re: How well do you know Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-05 16:33 +1000
    Re: How well do you know Python? Chris Angelico <rosuav@gmail.com> - 2016-07-05 16:38 +1000
      Re: How well do you know Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-05 18:22 +1000
        Re: How well do you know Python? Christian Gollwitzer <auriocus@gmx.de> - 2016-07-05 11:13 +0200
    Re: How well do you know Python? Chris Angelico <rosuav@gmail.com> - 2016-07-05 19:17 +1000
      Re: How well do you know Python? Quivis <quivis@domain.invalid> - 2016-07-05 21:55 +0000

csiph-web