Python Forum
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
average word length
#7
(Jul-18-2018, 06:14 AM)perfringo Wrote: Shouldn't it be
You're right
Output:
$ python Python 2.7.15 (default, May 1 2018, 16:44:08) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from string import letters >>> letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> $ python3 Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from string import letters Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'letters' >>> from string import ascii_letters >>>
Thanks for the catch :)
Reply


Messages In This Thread
average word length - by syn09001 - Jul-17-2018, 03:41 AM
RE: average word length - by micseydel - Jul-17-2018, 04:47 AM
RE: average word length - by perfringo - Jul-17-2018, 07:24 AM
RE: average word length - by micseydel - Jul-17-2018, 04:32 PM
RE: average word length - by perfringo - Jul-18-2018, 06:14 AM
RE: average word length - by syn09001 - Jul-17-2018, 09:04 PM
RE: average word length - by micseydel - Jul-18-2018, 08:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,549 Aug-12-2021, 04:25 PM
Last Post: palladium
  Python Speech recognition, word by word AceScottie 6 16,072 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 4,929 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  difference between word: and word[:] in for loop zowhair 2 3,705 Mar-03-2018, 07:24 AM
Last Post: zowhair
  Why isnt this word length selector working Ivan 6 4,642 Mar-26-2017, 08:38 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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