خروج این کد پایتون کدوم گزینه هستش؟
#python #challenge
☕️ @CodeExplore
def mystery_function(lst):
return sorted(set(lst), key=lambda x: (-lst.count(x), x))
sample_list = [3, 1, 2, 2, 3, 3, 1, 4, 4, 4, 4]
result = mystery_function(sample_list)
print(result)
#python #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥6❤🔥3⚡2
خروجی این کد سی شارپ کدوم گزینه هستش؟
#csharp #challenge
☕️ @CodeExplore
using System;
class Program
{
static void Main()
{
int[] numbers = { 1, 2, 3, 4, 5 };
int result = 0;
for (int i = 0; i < numbers.Length; i++)
{
if (i % 2 == 0)
{
result += numbers[i] * numbers[i];
}
else
{
result -= numbers[i];
}
}
Console.WriteLine(result);
}
}
#csharp #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
❤🔥5⚡3🔥2😁1
خروجی کد ++C زیر کدوم گزینه هست؟
#cpp #challenge
☕️ @CodeExplore
#include <iostream>
using namespace std;
void mysteryFunction(int &a, int b) {
a = a * b;
b = a + b;
}
int main() {
int x = 2, y = 3;
mysteryFunction(x, y);
cout << "x = " << x << ", y = " << y << endl;
return 0;
}
#cpp #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡6❤🔥4🔥3
خروجی کد پایتون زیر کدوم گزینه هست؟
#python #challenge
☕️ @CodeExplore
def tricky_function(a, b=[]):
b.append(a)
return b
list1 = tricky_function(1)
list2 = tricky_function(2, [])
list3 = tricky_function(3)
print(list1)
print(list2)
print(list3)
#python #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡5❤🔥3🔥3
خروجی کد جاوااسکریپت کدوم گزینه هست؟
#js #challenge
☕️ @CodeExplore
const value = 0.1 + 0.2;
console.log(value === 0.3);
#js #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥8❤🔥3⚡3😁3
خروجی کد جاوااسکریپت زیر کدوم گزینه هست ؟
#challenge #javascript
@CodeExplore
let foo = null;
console.log(foo === null);
console.log(typeof foo === 'object');
#challenge #javascript
@CodeExplore
🔥11⚡3❤🔥3😁1
خروجی این کد پایتون کدوم گزینست؟
#python #challenge
☕️ @CodeExplore
def compute_value(a, b):
if a % 2 == 0:
result = a * b
if result % 3 == 0:
return result // 3
else:
return result + 3
else:
result = a + b
if result % 5 == 0:
return result // 5
else:
return result - 5
output = compute_value(8, 7)
print(output)
#python #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡12🔥3❤🔥2
خروجی این کد کدوم گزینست؟
a)
15 15 5
20 10 5
b)
15 15 10
30 0 10
c)
15 15 5
25 10 5
d)
20 10 5
30 0 5
#cpp #challenge
☕️ @CodeExplore
#include <iostream>
using namespace std;
void modify(int &x, int &y, int z) {
x += z;
y -= z;
z *= 2;
}
int main() {
int a = 10;
int b = 20;
int c = 5;
modify(a, b, c);
cout << a << " " << b << " " << c << endl;
modify(a, b, c);
cout << a << " " << b << " " << c << endl;
return 0;
}
a)
15 15 5
20 10 5
b)
15 15 10
30 0 10
c)
15 15 5
25 10 5
d)
20 10 5
30 0 5
#cpp #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡9🔥6❤🔥4😁3
خروجی این کد پایتون کدوم گزینست؟
#python #challenge
☕️ @CodeExplore
def mystery_function(n):
if n == 0:
return 0
elif n % 2 == 0:
return mystery_function(n // 2)
else:
return 1 + mystery_function(n // 2)
print(mystery_function(10))
#python #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
❤🔥8⚡3🔥3
سایت HackerRank یک پلتفرم آنلاین برای تمرین و بهبود مهارتهای برنامهنویسی هستش. این سایت شامل چالشهای کدنویسی توی موضوعات مختلف مثل الگوریتمها، پایگاهدادهها، هوش مصنوعی و ریاضیاته. همچنین، HackerRank به کاربرا اجازه میده در مسابقات کدنویسی شرکت کنن و برای آمادهسازی مصاحبههای شغلی از تستهای تکنیکی استفاده کنن.
#programming #challenge
☕️ @CodeExplore
#programming #challenge
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡15❤🔥3🔥3