import math
import colorama
from colorama import Fore
colorama.init(autoreset=True)
#while y == 'y':
#True Position callout
truePosition = float(input("Enter True position callout: "))
#Nominal size
nominal_Diameter = float(input("Enter Nominal Diameter: "))
#Tol positive / negative
Tol = float(input("Enter Tolerance: "))
#Actual Diameter size
actual_Diameter = float(input("Enter Actual Diameter size: "))
#common distance of "x"
x_com = float(input("Enter X distance: "))
#common distance of "y"
y_com = float(input("Enter Y distance: "))
# X distance value
x = float(input("Enter actual X distance value: "))
# Y distance value
y = float(input("Enter actual Y distance value: "))
#deviation x
x_1 = x_com - x
#deviation y
y_1 = y_com - y
#true position formula
sqrt = math.sqrt(x_1**2 + y_1**2)
#true positon formula
true_position = 2 * (sqrt)
if true_position < truePosition:
print('Result: ', round(true_position, 3), Fore.GREEN + '(Accept)',)
else:
print('Reject')
#MMC or LMC
choiceOne = str(input("Enter MMC or LMC: "))
#show results for mmc or lmc based on user selection
if choiceOne == 'mmc' or 'MMC':
d_Mmc = nominal_Diameter - Tol
result1 = actual_Diameter - d_Mmc + truePosition
round2 = round(result1, 3)
if choiceOne == 'lmc' or 'LMC':
d_Mmc1 = nominal_Diameter + Tol
result2 = actual_Diameter - d_Mmc1 + truePosition
round3 = round(result2, 3)
else:
print('')
mmc_lmc = ''
mmc_lmc_Reject = ''
if choiceOne == 'mmc' or 'MMC':
mmc_lmc += 'MMC: '
elif choiceOne == 'lmc' or 'LMC':
mmc_lmc += 'LMC: '
if choiceOne == 'mmc' or 'MMC':
mmc_lmc_Reject += 'MMC reject: '
elif choiceOne == 'lmc' or 'LMC':
mmc_lmc_Reject += 'LMC reject: '
#display results for mmc or lmc with accept or reject
if 'mmc' or 'MMC' == true_position <= result1:
print(mmc_lmc, round2, '(accept)')
elif 'lmc' or 'LMC' == true_position <= result2:
print(mmc_lmc, round3, '(accept)')
else:
print('mmc_lmc_Reject')
**I need help, i can't solve when user type in mmc or lmc, then it will calculate base on what they type, because when i type in MMC it work well then i tried typing lmc it print out MMC results.
i tried different way to solve this, but i can't solve it and im new to python, mostly all the codes i do are quite basic, when i code more, that where i get connfuse and thinking what goes wrong in my codes, i tried solving it two days back but cant find solution to my codes and ask pro's here to help so i can learn what goes wrong.**