[Tutor] type() problem

Roelof Wobben rwobben at hotmail.com
Sun Aug 22 12:05:03 CEST 2010


Hello, 

 

This is my exercise:

 

Write Python code to make each of the following doctests pass:

"""
  >>> type(fruit)
  <type 'str'>
  >>> len(fruit)
  8
  >>> fruit[:3]
  'ram'
"""
I have made this :""""
  >>> type(fruit)
  <type 'str'>
  >>> len(fruit)
  8
  >>> fruit[:3]
  'ram'
"""
fruit="ramadana"
print "fruit heeft als type", type(fruit)
y=len(fruit)
print yz=fruit[:3]
print zEverything works fine except the type () does not give any input.WWhat am I doing wrong Roelof  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100822/ab273fa6/attachment.html>


More information about the Tutor mailing list