Python Forum
py4e book exercise not working when compiled
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
py4e book exercise not working when compiled
#3
thanks!
this is why it's confusing and I'd like to understand why the different results before I move on with the course.
this is what I get
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> data = 'From [email protected] Sat Jan  5 09:14:16 2008'
>>> atpos = data.find('@') 
>>> print (atpos)
21
>>> spos = data.find(' ',atpos) 
>>> print (spos)
-1
>>> host = data[atpos+1 : spos]
>>> print (host)
uct.ac.za Sat Jan  5 09:14:16 200
>>> 
Reply


Messages In This Thread
RE: py4e book exercise not working when compiled - by adriand - Jun-09-2018, 12:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  John Guttag Book - Finger Exercise 4 - need help to make the code better pritesh 12 10,758 May-06-2020, 05:10 PM
Last Post: riteshp
  Book exercise in lists sonedap 17 7,157 Feb-03-2019, 08:37 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020