Skip to content

Conversation

@Doppelok
Copy link

No description provided.

Let's start with the preparation of our input line before calculation. We will transfer to the variables "h"
and "m" the values of hours and minutes, respectively, already converted to the integer data type using
the map() and int() functions. The form of recording through coma "h, m = map (int, ...)" is equivalent
to the next form "h = int (...)" and "m = int (...)". We use the int() function to each item of the split

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

після int без пропусків

<div class="answer">
Let's start with the preparation of our input line before calculation. We will transfer to the variables "h"
and "m" the values of hours and minutes, respectively, already converted to the integer data type using
the map() and int() functions. The form of recording through coma "h, m = map (int, ...)" is equivalent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

після мап без пропуска

<pre class="brush: python">
import datetime
def sun_angle(time):
#replace this for solution

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

це можна прибрати

Look at this solution. With the help of the datetime module, we can perform our calculation in time units,
and only then translate the value into angle units.
<pre class="brush: python">
import datetime

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можна написати один раз from datetime import datetime і тоді далі не треба буде двічі писати datetime.datetime...буде трохи чистіший код

</div>
<div class="answer">
Тобі залишилось написати умову if за допомогою якої ти будеш повертати або результат, якщо сонце видно, або
фразу "I don't see the sun!", якщо сонця не видно. Використаємо для цього тренарний оператор.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тернарний

<pre class="brush: python">
import datetime
def sun_angle(time):
#replace this for solution

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зайве


<p>
Твоє завдання - знайти кут сонця над горизонтом, знаючи час доби. Вхідні дані: сонце сходить на Сході о 6:00 ранку,
що відповідає куту 0 градусів. О 12:00 вечора сонце сягає його зеніту, а це означає, що кут дорівнює 90 градусів.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

о 12 вечора сонце сягає зеніту?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Коли гугл перекладач не читав статтю в вікіпедії, яка закріплена в описі місії


<!-- Explain input and output values -->
<p>
<strong>Вхідні дані: </strong> Час доби.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..як рядок


<!-- Here you can explain some constraints for input-->
<!-- The section is optional -->
<p><strong>Передумова: </strong>:<br>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зайва двокрапка

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants