-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
11 lines (11 loc) · 923 Bytes
/
task.html
1
2
3
4
5
6
7
8
9
10
11
<b>Else comprehension</b> <a class=right href="https://hyperskill.org/learn/step/9887">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
<p>Write a program that converts a given list into a list with binary values: either 1 or 0. If the number in the initial list was greater than 0, in the binary list there should be 1, and if the number was less or equal, in the new list you should write 0. Naturally, use the list comprehension and print the result.</p>
<p><strong>Input format</strong>: a list with integer numbers, e.g. <code class="java">[5, 0, 4, -10]</code>.</p>
<p><strong>Output format</strong>: a list consisting of ones and zeros, e.g. <code class="java">[1, 0, 1, 0]</code>.</p>
</body>
</html><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/6315">Show topic summary</a>