No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hey all, I'm trying to write a Polynomial Class but I'm having some trouble. I'm having the coefficients and exponents stored in a dictionary, like so... [CODE] class Polynomial: def __init__(self, *termpairs): self.termdict = dict(termpairs) print (self.termdict) if __name__ == '__main__': d1 = Polynomial((2,3), (4,5), (8,9)) print (d1) [/CODE] This … | |
Hi all, I'm fairly new to python and I'm stuck with a problem. What I'm trying to do is write a recursive function that takes a list of integers and returns true if the list contains a single pair of integers whose sum is negative, and false otherwise. For example: … |