calculator

Why is this python program always giving a return of 0?

Why is this python program always giving a return of 0? Question: Whenever I run the program, it goes smooth without any errors. It’s just that this function always returns the value 0 and I can’t figure out why. Also, please don’t mind the names written in my language. def calcInit(): while True: vrednost = …

Total answers: 2

How do I calculate operations from a txt file?

How do I calculate operations from a txt file? Question: So I have a homework to write those expressions in a notepad, this is my input file: 4+1 12-3 2*182 8/2 then, I have to write a program in idle that will read that, line by line, that will solve the operations and return them …

Total answers: 1

For loop with if statement in Python (Solved)

For loop with if statement in Python (Solved) Question: I am trying to create a basic calculator in Python. I wrote all codes but i can not figure out to operate these codes for loop. Basically, after the calculation user have to go back start point and calculate again. Where should i put the "for …

Total answers: 1

Simple calculator not adding | Cant figure out why

Simple calculator not adding | Cant figure out why Question: first = input("Enter First Number: ") second = input("Enter Second Number: ") value = first + second print(first + "+" + second + "=" + value) I want it to add both numbers and give me the result for example 1+2=3, but it keeps doing …

Total answers: 1

python calculator indentation error (cant seem to get the program working)

python calculator indentation error (cant seem to get the program working) Question: I just started python yesterday so I was trying to make this python code to make a calculator that adds, multiplies, divides, and subtracts. When I started testing the code just wasn’t working even though I did similar things and to me, the …

Total answers: 2

TypeError: btn_add() missing 1 required positional argument: 'first_number'

TypeError: btn_add() missing 1 required positional argument: 'first_number' Question: I’m making a calculator in Python using Tkinter, and I’m getting an error im not sure as to why im running into this error but ive legit tried retyping the whole code and cant find anything about it on yt: ` from tkinter import * w …

Total answers: 2

if elif is giving the wrong result

if elif is giving the wrong result Question: It’s only giving me the result of the first operation wich is multiply even if my input was addition print(‘Calculator’) operation = input(‘Choose:n Mltiply(*)n Divise(/)n Add(+)n Subbstract(-)n ‘) if operation == ‘mutiply’ or ‘Multiply’ or ‘MULTIPLY’ or ‘*’: num1 = input(‘Write Your number :’) num2 = input(‘Write …

Total answers: 2

Converting UTM to Lat/Long without zone information

Converting UTM to Lat/Long without zone information Question: I’m trying to convert UTM data (easting/northing) to lat/long, but the data I’m using doesn’t have any zonal data. I know I could just use an online converter but I have thousands of rows so this isn’t viable. The data is already in my notebook as a …

Total answers: 1

Calculator not functioning properly

Calculator not functioning properly Question: Hey I’m trying to make a small calculator for a project, however I’m struggling to get the code to work. import time a = 100 b = 1 while a > b: print("Please select an operation. ") print("1. Multiply") print("2. Divide") print("3. Subtract") print("4. Add") b = 200 x = …

Total answers: 1