You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="orange" title = "The FOR statement is used to iterate over the elements of a sequence (such as a string, tuple or list) or other iterable object">for</span> substr <spanclass="orange">in</span> f1.read().split():
26
+
s = substr.split(<spanclass="green">'.'</span>)<spanclass="red"># ðàçáèâàåì âñå ýëåìåíòû ïî òî÷êå</span>
27
+
<spanclass="orange" title = "The IF statement is used for conditional execution">if</span><spanclass="spec" title = "The built-in function len() returns the length of a string">len</span>(s) == 2:<spanclass="red"># åñëè ÷èñëî ýëåìåíòîâ ðàâíî äâóì</span>
28
+
<spanclass="orange" title = "The IF statement is used for conditional execution">if</span> s[0] != <spanclass="green">''</span><spanclass="orange">and</span> s[1] != <spanclass="green">''</span>:<spanclass="red"># ïðîâåðÿåì ÷òî îáà ýëåìåíòà íå ïóñòûå</span>
29
+
<spanclass="spec" title = "conclusion on a screen">print</span> s
30
+
<spanclass="red"># ïðîâåðÿåì, ÷òîáû â îáîèõ ýëåìåíòàõ áûëè ÷èñëà</span>
31
+
<spanclass="orange" title = "The IF statement is used for conditional execution">if</span> s[1]>=<spanclass="green">'0'</span><spanclass="orange">and</span> s[1]<=<spanclass="green">'9'</span><spanclass="orange">and</span> s[0]>=<spanclass="green">'0'</span> and s[0]<=<spanclass="green">'9'</span>:
<spanclass="orange" title = "The IF statement is used for conditional execution">if</span><spanclass="spec" title="float([x]). Convert a string or a number to floating point">float</span>(s[1])!=0:
34
+
<spanclass="red"># çàïèñü â ôàéë, ñëèâàåì îáà ýëåìåíòà â âåùåñòâåííîå ÷èñëî</span>
0 commit comments