Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
str.endswith Output Query
#4
(Aug-18-2020, 07:30 PM)eddywinch82 Wrote: where the Date begins with the 6th Day of the month
(Aug-18-2020, 07:15 PM)eddywinch82 Wrote: The Date's for the Data are in the format :%d-%b-%Y

not sure what you mean by "begins" with 6th day of the month", when format ends with year, so endswith should return if year ends with '-6' or '-8'

spam = 'foo-6', 'foo-5', 'foo-8'
for egg in spam:
    if egg.endswith(('-6', '-8')):
        print(egg)
Output:
foo-6 foo-8
maybe give us runable example, including some sample data, that reproduce the problem.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
str.endswith Output Query - by eddywinch82 - Aug-18-2020, 07:15 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 07:19 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 07:30 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 08:09 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 08:32 PM
RE: str.endswith Output Query - by buran - Aug-18-2020, 08:40 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-18-2020, 09:28 PM
RE: str.endswith Output Query - by eddywinch82 - Aug-19-2020, 12:18 AM
RE: str.endswith Output Query - by eddywinch82 - Aug-21-2020, 11:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Query output in Tuple paulo79 2 2,029 Apr-07-2022, 12:54 PM
Last Post: paulo79
  Format SQL Query Output phillyfa 2 4,111 Apr-22-2020, 07:45 AM
Last Post: buran
  syntax for endswith a digit birdieman 2 5,690 Mar-04-2017, 07:21 PM
Last Post: birdieman

Forum Jump:

User Panel Messages

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