Skip to content

Commit

Permalink
Problems of the day
Browse files Browse the repository at this point in the history
  • Loading branch information
danfimov committed Feb 2, 2021
1 parent fd6c7e0 commit a7ba373
Show file tree
Hide file tree
Showing 21 changed files with 169 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("It isn`t in the section 'C:\\some\\name_of_file'")
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: code
files:
- name: main.py
visible: true
text: print('It isn`t in the section 'C:\some\name_of_file'')
learner_created: false
feedback_link: https://hyperskill.org/learn/step/12130#comment
status: Solved
feedback:
message: <html>Correct solution</html>
time: Tue, 02 Feb 2021 05:11:07 UTC
record: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: 12130
update_date: Sat, 23 Jan 2021 10:41:11 UTC
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h2>A little about strings</h2>
<html>
<head></head>
<body>
<p>Often programmers face a problem that can be solved by analogy. You are already familiar with the <code class="java">string</code> data type. Now you need to study the relevant section of the <a target="_blank" href="https://docs.python.org/3/tutorial/introduction.html#strings" rel="noopener noreferrer nofollow">documentation about strings</a> to solve this problem. In the documentation you will find the necessary similar examples.</p>
<p>Your task is to correct the code so that the output would be the following:</p>
<pre><code class="language-no-highlight">It isn`t in the section 'D:\some\name_of_file'</code></pre>
</body>
</html><br><b>Sample Input:</b><br><pre><code class="language-no-highlight"></code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">It isn`t in the section 'C:\some\name_of_file'</code></pre><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/12125">Show topic summary</a>
2 changes: 2 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Chaos/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
print(str(45/9 + 16*(5 + 8)))
print('mathematics')
14 changes: 14 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Chaos/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: code
files:
- name: main.py
visible: true
text: |-
print("45/9 + 16*(5 + 8)")
print(mathematics)
learner_created: false
feedback_link: https://hyperskill.org/learn/step/8310#comment
status: Solved
feedback:
message: <html>Correct solution</html>
time: Tue, 02 Feb 2021 05:21:36 UTC
record: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: 8310
update_date: Thu, 16 Jul 2020 08:20:21 UTC
8 changes: 8 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Chaos/task.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h2>Chaos</h2>
<html>
<head></head>
<body>
<p>Look at the code below and eliminate the chaos: the first line should print the resulting number of the calculation and the second line should print the word <code class="java">mathematics</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/6052">Show topic summary</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import requests


def get_content_type(url):
r = requests.get(url)
return r.headers['Content-Type']
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
type: code
files:
- name: main.py
visible: true
text: |-
import requests
def get_content_type(url):
pass
learner_created: false
feedback_link: https://hyperskill.org/learn/step/8609#comment
status: Solved
feedback:
message: <html>Correct solution</html>
time: Tue, 02 Feb 2021 05:28:00 UTC
record: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: 8609
update_date: Fri, 22 Jan 2021 05:09:05 UTC
17 changes: 17 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Content type/task.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h2>Content type</h2>
<html>
<head></head>
<body>
<p>Define a function <code class="java">get_content_type(url)</code> that, given a URL, sends a GET request and returns the content type of the response.</p>
<p>For example, <code class="java">get_content_type('http://google.com')</code> should return <samp>'text/html; charset=ISO-8859-1'</samp>, while <code class="java">get_content_type('http://github.com')</code> returns<samp> 'text/html; charset=utf-8'</samp>.</p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-437').style.display='inline'"> Hint </button> </p>
<div id="hint-437" style="display:none;">
You can find content type in the response headers.
</div>
<p></p>
</body>
</html><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 30 seconds</font><br><br>
<b>Caution</b><br><br>
You may see errors in your code or execution results due to missing context. Don’t worry about it, just write the solution and press Check.
<br><br>
<a href="https://hyperskill.org/learn/step/8603">Show topic summary</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import requests

from bs4 import BeautifulSoup

user_input = input()
r = requests.get(user_input)
soup = BeautifulSoup(r.content, 'html.parser')
result = soup.find('h1').text
print(result)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: code
files:
- name: main.py
visible: true
text: |-
import requests
from bs4 import BeautifulSoup
learner_created: false
feedback_link: https://hyperskill.org/learn/step/10213#comment
status: Solved
feedback:
message: <html>Correct solution</html>
time: Tue, 02 Feb 2021 05:18:25 UTC
record: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: 10213
update_date: Wed, 20 Jan 2021 13:22:20 UTC
14 changes: 14 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Get the title/task.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h2>Get the title</h2>
<html>
<head></head>
<body>
<p>Time to practice! Read the link to an article from the input. Print the heading of this article.</p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-159').style.display='inline'"> Hint </button> </p>
<div id="hint-159" style="display:none;">
Remember that headings are stored in the
<code class="java">&lt;h1&gt;</code> tag.
</div>
<p></p>
</body>
</html><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 30 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/10209">Show topic summary</a>
5 changes: 5 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Say hello/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def say_hello(name):
if name:
print(f'Hello, {name}!')
else:
print('Hello, Anonymous!')
12 changes: 12 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Say hello/task-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: code
files:
- name: main.py
visible: true
text: 'def say_hello(name):'
learner_created: false
feedback_link: https://hyperskill.org/learn/step/10961#comment
status: Solved
feedback:
message: <html>Correct solution</html>
time: Tue, 02 Feb 2021 05:09:05 UTC
record: -1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: 10961
update_date: Tue, 06 Oct 2020 02:30:45 UTC
12 changes: 12 additions & 0 deletions Python Developer/HyperJob Agency/Problems/Say hello/task.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h2>Say hello</h2>
<html>
<head></head>
<body>
<p>It's a common practice to say hello to users after they register on your website. In this task, you should implement a function that takes a string <code class="java">name</code> as an argument and <strong>prints</strong> "Hello, NAME!" where NAME is replaced by the user's name. However, some users might want not to disclose their name so <code class="java">name</code> can equal the empty string. In this case, your program should <strong>print</strong> "Hello, Anonymous!".</p>
<p>Your program shouldn't read any input or call the function, just implement it.</p>
</body>
</html><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">Eve</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">Hello, Eve!</code></pre><br><br><b>Sample Input:</b><br><pre><code class="language-no-highlight"></code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">Hello, Anonymous!</code></pre><br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<b>Caution</b><br><br>
You may see errors in your code or execution results due to missing context. Don’t worry about it, just write the solution and press Check.
<br><br>
<a href="https://hyperskill.org/learn/step/10327">Show topic summary</a>
5 changes: 5 additions & 0 deletions Python Developer/HyperJob Agency/Problems/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
content:
- Spellchecker
- 10 files
- Say hello
- A little about strings
- Get the title
- Chaos
- Content type

0 comments on commit a7ba373

Please sign in to comment.