Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List capital letters
#6
Thank you DeaD_EyE! Thank everyone!
This is such a smarter way.

text = 'Hello World'
upper_chars = [char for char in text if char.isupper()]
think in terms of putting (everytime) a code inside a function is not a god pratice. I think. In Python we have so many possibilities. So many ways to do the same thing.
Reply


Messages In This Thread
List capital letters - by ricardodepaula - Jul-21-2019, 05:09 PM
RE: List capital letters - by Yoriz - Jul-21-2019, 05:27 PM
RE: List capital letters - by DeaD_EyE - Jul-21-2019, 05:42 PM
RE: List capital letters - by ndc85430 - Jul-21-2019, 05:43 PM
RE: List capital letters - by DeaD_EyE - Jul-21-2019, 06:53 PM
RE: List capital letters - by ricardodepaula - Jul-21-2019, 11:35 PM
RE: List capital letters - by ndc85430 - Jul-22-2019, 05:37 AM
RE: List capital letters - by DeaD_EyE - Jul-22-2019, 06:45 AM
RE: List capital letters - by ricardodepaula - Jul-23-2019, 03:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  item from a line to list however when i print the line instead of words i get letters Sutsro 5 3,048 Apr-22-2020, 02:39 PM
Last Post: deanhystad
  Pynput - no capital letters jmair 2 4,622 Feb-12-2019, 09:53 PM
Last Post: jmair
  make a list of string in capital by using a function anancba 3 3,497 Nov-23-2017, 06:42 AM
Last Post: heiner55
  Ending loop with string (capital & lowercase) MattWilk97 3 3,495 Oct-22-2017, 09:13 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