Questions tagged [operands]

Operands are values acted upon by an operator, method, or other functional entity.

Operands differ from parameters in that they are the real values used or altered by a function, while the parameters are the named, abstract inputs used to define the function.

313 questions
-1
votes
1 answer

Operand error when using an integer in a list

I've been trying to work on this code for hours but keep getting to the same point every time. Basically I'm trying to add up all the values in an array. However, it keeps saying unsupported operand for integer and list. I'm confused why it is…
-1
votes
1 answer

unsupported operand type(s) error when using %s

I am trying to get this piece of code to work which passes some JSON output into a discord.py embed but I am having some issues, this is my piece of code. @client.event async def on_message(message): if message.content.startswith('!hello'): …
-1
votes
1 answer

Why use & over &&?

I know what & and | does - it evaluates both sides (or all conditions if more than 2) - but I can't say I've used those two operators for a very long time, I always used && and ||. e.g. (a != null) & (a.length == 1) would throw if we're checking the…
Omar.Ebrahim
  • 862
  • 1
  • 10
  • 30
-1
votes
1 answer

C++ no operator matches these operands

I copy/paste this console application, which is a banking record keeping system, and I get an error for the ">" operator not having operands; if (infile.read(reinterpret_cast(this), sizeof(*this)) > 0) Does it have something to do with types?…
JimGordon
  • 385
  • 3
  • 8
-1
votes
1 answer

bash run read a file and run the read line OR command

two commands with OR condition test -e a.txt || test -e b.txt this command running without any problem from CLI but if I read from a file and try to run it gives sh: ||: unknown operand' error cat test.txt test -e a.txt || test -e b.txt Read and…
Kenot Solutions
  • 377
  • 1
  • 4
  • 11
-1
votes
1 answer

Date command extra operand and "(" unexpected on script

I'm having the following error: bash power.sh date: extra operand ‘%s’ Try 'date --help' for more information. power.sh: line 16: [1578180864: command not found RAIL,POWER_AVG power.sh: line 27: 0 /0: division by 0 (error token is "0") or…
vfbsilva
  • 135
  • 8
-1
votes
1 answer

TypeError: unsupported operand type(s) for +: 'float' and 'list' in Python 3.6.8

I keep getting TypeError: unsupported operand type(s) for +: 'float' and 'list'. I am new to python programming and am trying to convert Matlab code into Python. Below is the tried python code. import math import cmath import numpy as np import…
Lokesh
  • 35
  • 1
  • 8
-1
votes
1 answer

TypeError: unsupported operand type(s) for +: 'int' and 'str' in a program that was executing well before

while doing this year = 2019 tariq1 = year+'-01-01' tariq2 = year+'-12-31' while year > 2015: for stock in string: max=quandl.get(stock, start_date=tariq1, end_date=tariq2) max year = year - 1 getting an error in the…
Abhishek Pal
  • 51
  • 1
  • 9
-1
votes
2 answers

Why does testing float for null produce compilation error ”invalid operands to binary == (have 'float' and 'void *')”?

scanf("%f", &lista2.pret); fflush(stdin); if (lista2.pret == NULL ) goto eror2; // error fseek(o,(nn-1)*sizeof(lista2),SEEK_SET); fwrite(&lista2,sizeof(lista2),1,o); break; } fclose(o); break; } Error: [Error]…
-1
votes
1 answer

error in case statement (ERROR 1241 (21000): Operand should contain 1 column(s))

I have a Table from that want to get records on the bases of gender and score like if the score is more than 70 than male data will display else female data for this i want to use case statement. mysql query is select…
-1
votes
1 answer

Unsupported operands str & int

I get TypeError: unsupported operands (str & int) at about line 5. I've looked up how to fix it but nothing has worked for me (it's a school assignment and I must use the if, elif, else form). I also couldn't seem to define the variable without…
Shawn
  • 1
  • 1
-1
votes
1 answer

Python != giving unexpected results

I came across a very confusing problem on a website for speed learning Python. It's about the operand != and how it works. The result/outcome of using != between 3 operands baffles me and my classmates. We have tried to search around and couldn't…
mini_way
  • 3
  • 1
-1
votes
1 answer

Why am I getting the error "bad operand types for binary operator" in my methods?

public class t{ private ArrayList a = new ArrayList(); public void add(T x){ a.add(x); } public T largest(){ T large = a.get(0); int count = 1; while(a.get(count)!=null){ if(a.get(count)>large) …
-1
votes
2 answers

Operand types are incompatible ("double*" and "int")

Getting this error from my code. I had looked at similar questions on here but wasn't able to see why mine wasn't working (most answers involved chars and people using " instead of ', which wasn't really helpful to me). Not sure what I'm missing…
Nick5227
  • 21
  • 1
  • 5
-1
votes
2 answers

invalid operands to binary expression?

I am trying to implement classes that use inheritance/polymorphism and I cant figure out why I am getting this error: invalid operands to binary expression error ('basic_ostream' and 'void') The error is within the…
Vivek Reddy
  • 92
  • 1
  • 1
  • 9