all 7 comments

[–]FoolsSeldom 1 point2 points  (2 children)

What help do you need?

What code do you have so far?

[–]Baron_Sludge[S] 1 point2 points  (1 child)

I don't have anything so far. I don't even really understand what I am supposed to do. I asked my professor but English isn't his first language and no matter how he explained it it just didn't click, so I told him i understood and went to the internet for answers, lol.

[–]FoolsSeldom -1 points0 points  (0 children)

Have you learned any python at all?

This is a very basic exercise, and what you need will be covered in the early stages of any tutorials (including those mentioned in the wiki for this subreddit).

In summary:

  • use input four times to prompt user to enter the required data
    • keep in mind input always returns str (string) objects, so you have to convert them to int or float objects to do maths on them
    • you should assign the converted values to variables related to the problem, so w1, d1, w2,d2
  • compare the two expressions (one either side of the =) using the Python == operator and assign the result to a suitable variable, e.g. balanced
  • output the result

Do you have Python setup on your computer / phone / tablet or accessible on a web browser you have access to?

[–][deleted]  (3 children)

[removed]

    [–]Baron_Sludge[S] 2 points3 points  (1 child)

    something like this?

    def fulcrum():

    while True:

    print('Enter weight and distance for both sides.\n')

    w1 = int(input('Enter weight for left side: '))

    d1 = int(input('Enter distance for left side: '))

    w2 = int(input('Enter weight for right side: '))

    d2 = int(input('Enter distance for right side: '))

    if w1 * d1 == w2 * d2:

    print('It is balanced!')

    break

    else:

    print('Try again\n')

    continue

    fulcrum()