Jan-11-2017, 09:32 PM
my_integers = [1,20,32,145,210,103] #loop for num in my_integers: if not num%5: print num #list comprehension nums_ending05 = [n for n in my_integers if not n%5] print nums_ending05
Detect if an integer ends in 0 or 5
|
|
Messages In This Thread |
Detect if an integer ends in 0 or 5 - by birdieman - Jan-11-2017, 09:05 PM
RE: Detect if an integer ends in 0 or 5 - by snippsat - Jan-11-2017, 09:20 PM
RE: Detect if an integer ends in 0 or 5 - by buran - Jan-11-2017, 09:21 PM
RE: Detect if an integer ends in 0 or 5 - by birdieman - Jan-11-2017, 09:28 PM
RE: Detect if an integer ends in 0 or 5 - by buran - Jan-11-2017, 09:32 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
pywin32: Outlook connection ends with 'operation aborted' on one machine | tstone | 0 | 2,325 |
May-03-2022, 04:29 AM Last Post: tstone |
|
Regex: a string does not starts and ends with the same character | Melcu54 | 5 | 2,369 |
Jul-04-2021, 07:51 PM Last Post: Melcu54 |
|
threadlocals are garbage collected before thread ends | akv1597 | 0 | 1,775 |
Mar-09-2021, 12:13 PM Last Post: akv1597 |
|
Running a few lines of code as soon as my timer ends | nethatar | 3 | 2,355 |
Feb-26-2021, 01:02 PM Last Post: jefsummers |
|
Writing to file ends incorrectly | project_science | 4 | 2,641 |
Jan-06-2021, 06:39 PM Last Post: bowlofred |
|
Keep Application running after Python script ends | PEGylated_User | 0 | 1,944 |
Nov-12-2020, 03:27 PM Last Post: PEGylated_User |
|
Script ends, does not start again | phanegem | 8 | 5,016 |
Mar-30-2017, 07:36 PM Last Post: nilamo |