Computer Science

IT Matura Course | Algorithms #1


categories: computer science

Hello everyone,
Below you will find a video with a detailed explanation of the algorithm for determining a prime number. Its operation, time complexity, and usefulness. Below you will also find ready-made code to copy if needed.
Code:


import math

a = int(input())

def pierwsza(a):
    if a < 2:
        return False

    for i in range(2, int(math.sqrt(a)) + 1):
        if a % i == 0:
            return False
    return True

print(pierwsza(a))
                  

Video:

Thank you for reading!


Read more
Administrator

This post was written by the administrator

Recent Posts

Proof Problems in Mathematics The Beginning Integrals, Course Practical Physics for Engineers IT Matura Course | Algorithms IT Matura Course | Databases IT Matura Course | Theory IT Matura Course | Spreadsheet

Archive

Year 2022

Comments