- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
8 Posted Topics
Hi,there, I need to definea function make_tree(preorder, inorder). This function returns the Node which is the root of a binary tree with the pre-order and in-order traversals given as lists of values in the parameters. If either preorder or inorder is empty, the other must also be empty, and the …
Hi, I don't know the difference between class variables and instance variables. Can anybody give me an example? Thank you so much:)
class Toy(object): def play(self, toy): ''''Print squeak''' print 'Squeak!' class Dog(object): def __int__(self, name): '''Name a dog''' self.name = name def call(self, shout): '''Return true if shout is exactly 'Here, n!', otherwise return False''' return shout == 'Here, ' + str(self.name) + '!' def play(self, toy, n): '''Print 'Yip! ' …
Hi,there, assert pop == "berg", "Item removed from the stack was not \"berg\"." why using '...' can avoid syntax error ? Thank you :)
Hi there, Can anybody tell me what is[B] internal documentation[/B] and what is[B] external documentation[/B] based on the following example: def is_palindrome(s): '''If the str is a palindrome which is a phrase that reads the same \ forwards and backwards return True; otherwise, return False.Assume that\ there are only lowercase …
what can i get from object.attribute? what does it do? Thank you :)
hi can anybody tell me what does the following code mean?Thank you [B]import[/B] sys [B]print [/B]>> sys.stderr, 'Fatal error: invalid input!' logfile = open('/tmp/mylog.txt', 'a') [B]print[/B] >> logfile, 'Fatal error: invalid input!' logfile.close() Editor's note: Please don't hijack someone else's unrelated thread, start your own thread with the proper title.
The End.
eva yang