User Profile

Collapse

Profile Sidebar

Collapse
shahram555
shahram555
Last Activity: Sep 4 '14, 01:16 AM
Joined: Aug 11 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • shahram555
    started a topic how can I delet "None" in code output

    how can I delet "None" in code output

    Code:
    >>class class1:
         name='civil'
         def printname(self,name):
             print self.name
             print name
    >>you=class1()
    >>you.mark=100
    >>print you.printname('shahram'),you.mark
    
      civil
      shahram
      None 100
    See more | Go to post

  • shahram555
    started a topic help me with classMaker

    help me with classMaker

    I have seen this code in a book.according to this book,as we run code and type 'classMaker()' will see this:
    >>> classMaker()
    making the class
    do you want to make an object of the class?
    -------------
    and then we answer:yes,

    >>>classMaker ()
    making the class
    do you want to make an object of the class?
    yes
    object made
    your name is Raman
    --------------------...
    See more | Go to post
    Last edited by bvdet; Aug 30 '14, 12:09 PM. Reason: More descriptive title

  • shahram555
    started a topic what is this error?

    what is this error?

    Code:
    c={'a':1,'b':2}
    c.has_key('a')
    Traceback (most recent call last):
    File "<pyshell#3 2>", line 1, in <module>
    c.has_key('a')
    AttributeError: 'dict' object has no attribute 'has_key'


    Why does this fail?
    See more | Go to post
    Last edited by bvdet; Aug 13 '14, 11:24 AM. Reason: Spelling, clarify question

  • shahram555
    started a topic what dose this code do exactly?

    what dose this code do exactly?

    Code:
    import random
    for i in range(10):
        x=random.triangular(1,2,3)
        print(x)
    See more | Go to post
    Last edited by bvdet; Aug 11 '14, 12:41 PM. Reason: Fix indentation
No activity results to display
Show More
Working...