• PINEHACKS

    The exact output is this, although it is from the original code I posted on top: Enter a Number: 25

    THINKING.
    THINKING..
    THINKING...

    5 times 5 is 25

    25 is not a prime number, the number has factors more than 1 and the number itself.

    Enter a number:

    posted in Pythonista read more
  • PINEHACKS

    If possible could I get any help with getting sound to work and having a way to list Apple Music songs and choose one to play, plz.

    posted in Pythonista read more
  • PINEHACKS

    I have some python prime number code which finds out prime numbers. I was looking for a way to make it more efficient as this currently checks for all factors until it reachers the number, it possible could you make the explainations simple as I am 13. Here is the code:

    import time
    
    print('Made by Yasas Kulatunga, Dhari Prashanth and Dhivy Prashanth')
    print(' ')
    number = int(input("Enter a Number: "))
    print(' ')
    time.sleep(0.5)
    print('THINKING.')
    time.sleep(0.5)
    print('THINKING..')
    time.sleep(0.5)
    print('THINKING...')
    time.sleep(0.5)
    
    print(' ')
    c = 0
    while number:
        for i in range(2,number):
         if number % i == 0:
                print(str(i),"times",str(number//i),"is",str(number))
                time.sleep(0.3)
                c = c + 1
        if c == 0:
            print(' ')
            print(str(number),"has no factors apart from 1 and itself, therefore it is a prime number")
            print(' ')
            time.sleep(0.3)
        else:
            print(' ')
            print(str(number),"is not a prime number, the number has factors more than 1 and the number itself.")
            print(' ')
            time.sleep(0.3)
        number = int(input('Enter a number: '))
        print(' ')
        time.sleep(0.3)
        c = 0
    

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!