Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rainbow_or_age(rainbowage):
- if rainbowage.isalpha(): # checks if the argumment is an alphabet and does the follwing
- Print("String")
- elif rainbowage.isdigit(): # checks if argumment is a digit and does the following
- print("Digit")
- else:
- return False
- rainbow_or_age(2) # here i call the fucntion
- # here i get the error!
- #---------------------------------------------------------------------------
- #AttributeError Traceback (most recent call last)
- #<ipython-input-25-e32b3f32e450> in <module>()
- #----> 1 rainbow_or_age(2)
- #<ipython-input-19-1659c3081cd9> in rainbow_or_age(rainbow)
- # 2 def rainbow_or_age(rainbow):
- # 3 rainbowage = rainbow
- #----> 4 if rainbowage.isalpha():
- # 5 return rainbow_color() , rainbowage
- # 6 elif rainbowage.isdigit():
- #AttributeError: 'int' object has no attribute 'isalpha'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement