0

Guys which code used find Number which are ending with 9(or any other particular number)?

27th Jun 2020, 4:21 PM
Mohammad Bilal
Mohammad Bilal - avatar
2 Respuestas
+ 13
str(number).endswith(str(digit)) or str(number)[-1] == str(digit) or number % 10 == digit or number - (number // 10 * 10) == digit
27th Jun 2020, 4:30 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
str(number) [::-1][0]==digit
27th Jun 2020, 5:07 PM
Oma Falk
Oma Falk - avatar