python - I need to use multiple conditions in a while statement -
I am new to coding and I have very little idea what I am doing. So it can be very wrong but I have to make a code that determines the slope and Y interrupts. I have created a loop to determine whether any coordinates are the same and if they are then they should be replaced, although I have trouble getting out of the loop. Here's my current loop. Any help would be appreciated. ! thank you in advanced! Def whileloop (): While correct: y1 == y2 or x1 == x2 print ("error") print ("Please enter the values that are not equal to one another. Print "Y1_str = input" (Please enter y1 ") y2_str = input (" Please enter y2: ") (" Please enter the values that are not equal to one another. ") X1_str = Input (" Please enter x1 ") x2_str = input (" please enter x2: ") and: y1! = Y2 or x1! = X2
I thinks what do you want Something like this:
def whileloop (): while correct: y1_str = input ("please enter y1:") Y2_str = input ("please enter y2") x1_str = input (" Please enter x1 ") x2_str = input (" please enter x2 ") y1 = float (y1_str) y2 = float (y2_str) x1 = float (x1_str) x2 = float (x2_str) if y1 == y2 or x1 == X2: Public relations Int ("Please enter the values which are not equal to one another.") And: y1, y2, x1, x2
Comments
Post a Comment