Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to correct a string in python? [closed]

$
0
0

Good day!

today = 2004 - is a date and month clipping from the full date in the format day.month.year = April 20, 2024

bdate parsed in day.month.year format

Вотздесь member['bdate'][-4:] It turns out that 4 characters are cut off (but for some reason day and month) and it turns out 2004, but it should be cut off year and then everything will be fine.

birthday_members = [member for member in members if member.get('bdate') and member['bdate'][-4:] == today]

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>