harand1
چهارشنبه 23 اسفند 1391, 19:34 عصر
سلام
لطفا راهنمای کنید چرا این که با پایتون نوشتم خروجی درست نداره
while print("Menu:");
select();
def menu():
print("#1 Sum of 2 numbers");
print("#2 Subtraction of 2 numbers");
print("#3 Division of 2 numbes");
print("#4 Multiplication of 2 numbers");
def c1():
print("Choice = #1");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Sum of " , num1 , " and " , num2 , " is : ", num1 + num2 ;
def c2():
print("Choice = #2");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Subtraction of Number 1 and Number 2 is : ", num1 - num2;
def c3():
print("Choice = #3");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Division of " ,num1, " and ", num2 ,"is : ", num1 / num2;
def c4():
print("Choice = #4");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Multiplication of " ,num1, " and ", num2 ,"is : ", num1 * num2;
def select():
menu();
choice = input ("Enter choice #number : ");
if(choice == 1):
c1();
elif (choice ==2):
c2();
elif(choice == 3):
c3();
elif(choice == 4):
c4();
else : print "INVALID", choice;
print ("\n");
select()
)
لطفا راهنمای کنید چرا این که با پایتون نوشتم خروجی درست نداره
while print("Menu:");
select();
def menu():
print("#1 Sum of 2 numbers");
print("#2 Subtraction of 2 numbers");
print("#3 Division of 2 numbes");
print("#4 Multiplication of 2 numbers");
def c1():
print("Choice = #1");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Sum of " , num1 , " and " , num2 , " is : ", num1 + num2 ;
def c2():
print("Choice = #2");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Subtraction of Number 1 and Number 2 is : ", num1 - num2;
def c3():
print("Choice = #3");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Division of " ,num1, " and ", num2 ,"is : ", num1 / num2;
def c4():
print("Choice = #4");
num1 = input ("First Number ? : ");
num2 = input ("Second Number ? : ");
print " Multiplication of " ,num1, " and ", num2 ,"is : ", num1 * num2;
def select():
menu();
choice = input ("Enter choice #number : ");
if(choice == 1):
c1();
elif (choice ==2):
c2();
elif(choice == 3):
c3();
elif(choice == 4):
c4();
else : print "INVALID", choice;
print ("\n");
select()
)