[Tutor] Questions come and questions go, but I will email forever

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Oct 28 01:39:57 CEST 2004



On Wed, 27 Oct 2004, Jacob S. wrote:

> print '''\tI need help. The bottom line is, I am having extreme difficulties
> with messy code.\r\n
> My program has problems. There are two different scenes I want to implement
> using VPython,\r\n


Hi Jacob,


Quick note: if you use the triple-quoted strings, you don't have to put
explicit '\r\n' characters at the end of each line: they're included as
part of the string.  For example:

###
>>> message = """hello
... world
... this
... is
... a
... test"""
>>> message
'hello\nworld\nthis\nis\na\ntest'
>>>
###

You're writing an email: it doesn't have to be double spaced.  *grin*



> but I originally combined both of their codes together. Now, I want to put
> them into seperate\r\n
> functions so that I can call them. As it is, the two functions would have to
> reference each other.\r\n

Hmmm.  I'm still slightly confused about this.  Can you show us what those
two functions look like?  There might be a way of disentangling them so
that they don't reference each other.  And if not, at least we'll be able
to see why.

Global variables are almost always a Very Bad Idea.  Can you show us an
example where it would be useful?


Best of wishes to you!



More information about the Tutor mailing list