Python Forum
Find first letter from a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find first letter from a list
#1
Hello. I have function that finds first letter in all words from list. And I want to count all lower cases. I don't understand why quantity updates only once.
arr=[["Hello","how","are","you"],["I","am","fine"]
def first_letter(x):
    abc = "abcdefghijklmnopqrstuvwxyz"
    quantity=0
    for j in range(0,len(x)):
        letter= x[j][1]
        if x[j][1] in abc:
            quantity=+1
            
            
    print(quantity)
Reply


Messages In This Thread
Find first letter from a list - by DariusCG - Nov-27-2019, 10:41 PM
RE: Find first letter from a list - by ichabod801 - Nov-27-2019, 10:52 PM
RE: Find first letter from a list - by DariusCG - Nov-27-2019, 11:05 PM
RE: Find first letter from a list - by ichabod801 - Nov-27-2019, 11:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  look at first letter in list and append word for assertion mapypy 3 1,996 Feb-06-2021, 05:45 PM
Last Post: buran
  How to find difference between elements in a list? Using beginner Basics only. Anklebiter 8 4,442 Nov-19-2020, 07:43 PM
Last Post: Anklebiter
  To find the index of the first occurrence of the key in the provided list Angry_bird89 4 3,335 Jun-20-2020, 06:53 PM
Last Post: Angry_bird89
  How do you find the length of an element of a list? pav1983 13 5,062 Jun-13-2020, 12:06 AM
Last Post: pav1983
  Find 'greater than' items in list johneven 2 4,516 Apr-05-2019, 07:22 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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