Skip to content

Dev#2

Open
nadavtzaysler wants to merge 3 commits intomainfrom
dev
Open

Dev#2
nadavtzaysler wants to merge 3 commits intomainfrom
dev

Conversation

@nadavtzaysler
Copy link
Owner

No description provided.

Comment on lines +3 to +6
def calculate_triangular_number(num: int) -> int:
if num <= 0:
return 0
return sum(range(num + 1))

Choose a reason for hiding this comment

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

Original comment

Although the name sounds great, it's not very accurate as not all positive integers belong to the triangular numbers sequence (1, 3, 6, 10, 15...).
I more suitable name would be calculate_sum_up_to or something like that.

Choose a reason for hiding this comment

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

Also, here.

Comment on lines +35 to +40
def print_numbers(num: int) -> None:
for i in range(num):
if is_prime(i):
print(f"{i} is prime")
else:
print(f"{i} is not prime")

Choose a reason for hiding this comment

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

Here.

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