Prerequisite #
Write a short description, that will describe the title or something informational and useful.
Add Your Heading Text Here #
Add Your Heading Text Here #
🐍
Pythone
Copy to clipboard
1
2
def calculate_discount(price, discount_percent):
return price - (price * discount_percent / 100)
🐘
Php
Copy to clipboard
1
2
3
4
5
6
7
function getEvenNumbers($max) {
$result = [];
for ($i = 2; $i <= $max; $i += 2) {
$result[] = $i;
}
return $result;
}
🔷
C#
Copy to clipboard
1
2
3
4
5
6
7
public static int[] GetEvenNumbers(int max) {
List<int> result = new List<int>();
for (int i = 2; i <= max; i += 2) {
result.Add(i);
}
return result.ToArray();
}