Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
What do you think the best way is to extract active users from the list below in Python?

users = [
{
"email":"ali@gmail.com",
"is_active":True
},
{
"email":"mohi@gmail.com",
"is_active":True
},
{
"email":"reza@live.com",
"is_active":False
},
{
"email":"marziyeh@gmail.com",
"is_active":False
}
]

Waiting for the answers :)

#python #question
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits in a given base. Here we will restrict ourselves to decimal (base 10).

For example, take 153 (3 digits):
1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153

and 1634 (4 digits):
1^4 + 6^4 + 3^4 + 4^4 = 1 + 1296 + 81 + 256 = 1634

The Challenge:

Your code must return true or false depending upon whether the given number is a Narcissistic number in base 10.

NOTE: Error checking for text strings or other invalid inputs is not required, only valid integers will be passed into the function.

#python #question #codewars
Move the first letter of each word to the end of it, then add "ay" to the end of the word. Leave punctuation marks untouched.

Examples:

pig_it('Pig latin is cool') # igPay atinlay siay oolcay
pig_it('Hello world !') # elloHay orldway !

#question #codewars #algorithm