-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
22 lines (22 loc) · 1.48 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<b>snake_case</b> <a class=right href="https://hyperskill.org/learn/step/9476">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
<p>Since we are learning Python, sometimes it might be useful to convert texts from <samp>lowerCamelCase</samp> to <samp>snake_case</samp>. The main trick is to find the correct place where to insert an underscore. Let's make a rule that it's right before a capital letter of the next word.</p>
<p><strong>The input format:</strong></p>
<p>Read a word or a phrase written in <samp>lowerCamelCase</samp>.</p>
<p><strong>The output format:</strong></p>
<p>Print out words in lowercase and separate them by underscores.</p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-577').style.display='inline'"> Hint </button> </p>
<div id="hint-577" style="display:none;">
The string methods
<code class="java">str.isupper()</code> and
<code class="java">str.islower()</code> might come in handy. You can use them to check the case and obtain either
<code class="java">True</code> or
<code class="java">False</code> value in response.
</div>
<p></p>
</body>
</html><br><b>Sample Input:</b><br>python<br><b>Sample Output:</b><br>python<br><br><b>Sample Input:</b><br>parselTongue<br><b>Sample Output:</b><br>parsel_tongue<br><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/6065">Show topic summary</a>