Home computer programming, others [python] prime number
computer programmingothers

[python] prime number

this is prime number code in python

print("Membuat tampilan bilangan prima dari 1-100")
numBig = 100
banyak = 0
for a in range(2, numBig) :
    prima = 1
    num = a
    for i in range(2,num):
        if(num % i) == 0:
            prima += 1
    if prima < 2:
        print(num, "adalah bilangan prima")
        banyak += 1
print("dari",numBig,"angka, ada sebanyak",banyak ,"bilangan prima")

Author

Ronny

Leave a Reply