User Profile

Collapse

Profile Sidebar

Collapse
Arshali12
Arshali12
Last Activity: Nov 20 '23, 05:50 AM
Joined: Aug 18 '23
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Arshali12
    started a topic GCD of two numbers in Python

    GCD of two numbers in Python

    I am trying to write a Python program to find the greatest common divisor of two numbers in Python. I have been following the algorithm described here, but I am having trouble getting it to work.
    Code:
    def gcd(a, b):
        while b != 0:
            a, b = b, a % b
        return a
    When I run this code, I am getting an error:
    Code:
    Traceback (most recent call last):
      File "gcd.py", line 4, in <module>
    ...
    See more | Go to post

  • Here are my recommendations :

    Start with the basics. Before you learn any specific programming language or technology, it is important to have a solid understanding of the fundamentals of programming. This includes topics such as data types, variables, conditional statements, loops, and functions. You can learn these concepts by taking an online course or reading a book on programming fundamentals.
    Choose a programming language....
    See more | Go to post

    Leave a comment:


  • Arshali12
    started a topic My two arrays look like this:

    My two arrays look like this:

    Code:
    $array1 = array(
    'ADAIR',
    'ADAM',
    'ADAMINA',
    'ADDISON',
    'ADDY',
    'ADELLE',
    'ADEN',
    'ADOLPH',
    'ADRIANNA'
    );
    
    $array2 = array(
    'ADAIR',
    'ADAMINA',
    'ADRIANNA'
    );
    How do I create a third array that is unique? Take the first array and eliminate duplicates from the second array.
    See more | Go to post
No activity results to display
Show More
Working...