Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 134 in /var/www/tg-me/post.php on line 75
Библиотека питониста | Python, Django, Flask | Telegram Webview: pyproglib/6596 -
Telegram Group & Telegram Channel
🕵️ Играем в ревью: сможете найти все 5 багов?

Быстрая проверка скиллов. В этом кусочке кода спрятаны 5 ошибок.

Цель программы: для каждого числа в списке определить, является ли оно простым (prime), и вернуть список булевых значений.

def is_prime(n):
if n <= 1:
return False

for i in range(2, n//2):
if n % i == 0:
return False
return True

def check_primes(numbers):
result = []
for num in numbers:
result.append(is_prime(num))
return result

nums = [0, 1, 2, 3, 4, 5, 10, 11, 13, 15, 17, 19]
print(check_primes(nums))


Вывод сейчас:
[False, False, True, True, True, True, False, True, True, False, True, True]


🎯 Ваша задача — найти все 5 ошибок. Пишите свои ответы в комментариях — обсудим вместе!

👀 Ответ выложу позже.

P.S. Инструкция о том, как оставить комментарий

Библиотека питониста #развлекалово
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/pyproglib/6596
Create:
Last Update:

🕵️ Играем в ревью: сможете найти все 5 багов?

Быстрая проверка скиллов. В этом кусочке кода спрятаны 5 ошибок.

Цель программы: для каждого числа в списке определить, является ли оно простым (prime), и вернуть список булевых значений.

def is_prime(n):
if n <= 1:
return False

for i in range(2, n//2):
if n % i == 0:
return False
return True

def check_primes(numbers):
result = []
for num in numbers:
result.append(is_prime(num))
return result

nums = [0, 1, 2, 3, 4, 5, 10, 11, 13, 15, 17, 19]
print(check_primes(nums))


Вывод сейчас:
[False, False, True, True, True, True, False, True, True, False, True, True]


🎯 Ваша задача — найти все 5 ошибок. Пишите свои ответы в комментариях — обсудим вместе!

👀 Ответ выложу позже.

P.S. Инструкция о том, как оставить комментарий

Библиотека питониста #развлекалово

BY Библиотека питониста | Python, Django, Flask




Share with your friend now:
tg-me.com/pyproglib/6596

View MORE
Open in Telegram


Библиотека питониста | Python Django Flask Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Can I mute a Telegram group?

In recent times, Telegram has gained a lot of popularity because of the controversy over WhatsApp’s new privacy policy. In January 2021, Telegram was the most downloaded app worldwide and crossed 500 million monthly active users. And with so many active users on the app, people might get messages in bulk from a group or a channel that can be a little irritating. So to get rid of the same, you can mute groups, chats, and channels on Telegram just like WhatsApp. You can mute notifications for one hour, eight hours, or two days, or you can disable notifications forever.

Библиотека питониста | Python Django Flask from us


Telegram Библиотека питониста | Python, Django, Flask
FROM USA