-
-
Save prodevo/2527efc006a0e063a2422ee3a0b73580 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 0 | |
for i in range(10): | |
i+=1 | |
a+=i | |
print(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = 0 | |
for c in range(16): | |
f = (c * 1.8) + 32 | |
print(f'C: {c} F: {round(f, 2)}') | |
c+=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = int(input('vvedit chyslo: ')) | |
for i in range(1, a): | |
a*=i | |
i+=1 | |
print(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = input('vvedit chyslo: ') | |
s = 0 | |
c = 0 | |
for i in a: | |
c+=1 | |
s += int(i) | |
print('dovzhyna:', c) | |
print('suma: ', s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = int(input('vvedit chyslo: ')) | |
for i in range(1, a): | |
if a % i == 0: | |
print(i) | |
i+=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input('vvedit vysotu: ')) | |
for i in range(1, n + 1): | |
print(' ' * (n - i), '*' * (2 * i - 1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input('vvedit vysotu: ')) | |
for i in range(1, n + 1): | |
print(' ' * (n - i), '*' * (2 * i - 1)) | |
for i in range(n, -1, -1): | |
print(' ' * (n - i), '*' * (2 * i - 1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = 0 | |
f1 = 1 | |
while True: | |
print(f, f1) | |
f += f1 | |
f1 += f | |
if f > 10000000 or f1 > 10000000: | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for a in range(2, 10000000): | |
for i in range(2, (a//2)+1): | |
if a % i == 0: | |
break | |
else: | |
print(a) | |
#наче працює, але одне й те саме число друкує купу разів |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment