how to add a button to python [closed]

How can i add a button that open chrome in python I already wrote the window_page know I need the button here is the code:

from tkinter import *
window = Tk()
window.title("Python GUI App")
window.configure(width=500, height=300)
window.configure(bg='lightgray')
window.mainloop()

Answer

The problem lies with your structure. If you use else it always refers to the last if and all else if between it. So if your last if is false, which happens if the signL is not "%" you will always enter the else.

To fix that you would need to fix your if statements, with use of else if statements.

Example with IF Conditions:

if (signL == "*") {
    Console.Write("result is: ");
    Console.WriteLine(frsIn * secIn);
}
else if (signL == "+") {
    Console.Write("result is: ");
    Console.WriteLine(frsIn + secIn);
}
else if (signL == "/") {
    Console.Write("result is: ");
    Console.WriteLine(frsIn / secIn);
}
else if (signL == "-") {
    Console.Write("result is: ");
    Console.WriteLine(frsIn - secIn);
}
else if (signL == "%") {
    Console.Write("result is: ");
    Console.WriteLine(frsIn / secIn);
}
else {
    Console.Write("Wrong");
}

Or you could use a switch case which I would advise when you want to check for constant variables.

Example with switch Case:

switch(signL) {
case "*":
    Console.Write("result is: ");
    Console.WriteLine(frsIn * secIn);        
    break;
case "+":
    Console.Write("result is: ");
    Console.WriteLine(frsIn + secIn);        
    break;
case "/":
    Console.Write("result is: ");
    Console.WriteLine(frsIn / secIn);        
    break;
case "-":
    Console.Write("result is: ");
    Console.WriteLine(frsIn - secIn);        
    break;
case "%":
    Console.Write("result is: ");
    Console.WriteLine(frsIn / secIn);        
    break;
default:
    Console.Write("Wrong");
    break;
}