I am having trouble getting the proper result in this code:
class Commerce():
def Entry(_sub, test):
while True:
if _sub == "Maths" or "Busines Studies" or "Accounts" or "Economics" or "Physical Education" or "English":
try:
print("Enter marks of ", _sub, "in", test, end="=>")
x = int(input())
except:
print("Invalid input")
continue
if x in range(0, 41):
return x
break
else:
print("Marks exceded, please try again ")
else:
print("Invalid marks")
continue
class Restrict():
def limitalnum(content):
punctuations =['!','(',')','-','[',']','{','}',';',':',"'",'"',"\\",',','<','>','.','/','?','@','#','$','%','^','&','*','_','~']
count=3
while True:
ask_input=input('%s'%content)
if ask_input.isalnum()==False:
count=count-1
if count in[3,2,1]:
print("Sorry only alphabets and numeric are acceptable")
print("Remaing retry of above entry:%s"%count)
else:
pass
if count==0:
print("Remaing retry of above entry:%s"%count)
print("We are sorry you have exhausted all retry's")
break
continue
else:
break
Stream_option=Restrict.limitalnum("Which Stream you are currently pursuing")
if Stream_option=='1' or 'Maths':
MATHS_PT_MARKS=Commerce.Entry("Maths","Periodic Test-1")
elif Stream_option == '2' or 'Informatics Practices' or 'IP':
IP_PT_MARKS=Commerce.Entry("IP","Periodic Test-1")
elif Stream_option == '3' or 'Hindi':
HI_PT_MARKS = Commerce.Entry("Hindi","Periodic Test-1")
Output Coming: Which Stream you are currently pursuing: 2 Enter marks of Maths in Periodic Test-1=>
Output Expected : Which Stream you are currently pursuing: 2 Enter marks of IP in Periodic Test-1=>
I don't know for sure if i used if condition properly or not, Thanks
This question is not duplicate for any other questions in Stack Overflow What i am trying to get it calling a function from a class in a conditional statement
Uniqueness: If the Conditional statement is true Execute the function If the conditional statement is False Pass to next line of command