Python Forum
Trying to find first 2 letter word in a list of words
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to find first 2 letter word in a list of words
#3
Hello ndc85430

I am trying to teach myself Python from How to Think Like a Computer Scientist so I must admit to being very much a tyro, please forgive my lack of knowledge. Now answering your hint I think that the first iteration passing over "this" produces a False and so the function should continue on to the second word in the list "is", which is a 2 letter word so the function should return True and stop iterating at that point and move to the print command outputting "The first 2 letter word is is". I still cannot see why the function does not do this.
Reply


Messages In This Thread
RE: Trying to find first 2 letter word in a list of words - by Oldman45 - Aug-08-2020, 05:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find Common Elements in 2 list quest 4 287 Apr-14-2021, 03:57 PM
Last Post: quest
  Function to count words in a list up to and including Sam Oldman45 13 711 Feb-18-2021, 10:22 AM
Last Post: perfringo
  Trying to get the first letter of every word in a list DanielCook 2 347 Jan-05-2021, 05:06 PM
Last Post: deanhystad
  List of error codes to find (and count) in all files in a directory tester_V 8 598 Dec-11-2020, 07:07 PM
Last Post: tester_V
  Find _ in a list 1234 15 947 Dec-01-2020, 07:53 PM
Last Post: bowlofred
  how to check if string contains ALL words from the list? zarize 6 888 Jul-22-2020, 07:04 PM
Last Post: zarize
  How to find the first and last of one of several characters in a list of strings? tadsss 2 590 Jun-02-2020, 05:23 PM
Last Post: bowlofred
  Find index value in List Martin2998 3 770 May-12-2020, 02:17 PM
Last Post: deanhystad
  item from a line to list however when i print the line instead of words i get letters Sutsro 5 729 Apr-22-2020, 02:39 PM
Last Post: deanhystad
  Cant Append a word in a line to a list err "str obj has no attribute append Sutsro 2 620 Apr-22-2020, 01:01 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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