Questions tagged [operand]

177 questions
2
votes
3 answers

Checking if input has letters in it

My error appears on this line: if exclude3 not in Sent: And it is: TypeError: 'in ' requires string as left operand, not set My code is: import string Word = input("Please give a word from the sentence") exclude3 =…
Out North
  • 43
  • 5
2
votes
2 answers

Accessing values from Constant Pool Java Bytecode

I have the following code: public static void f(){ double i = 0.0; for(i = 0.0; i<100.0; i++){} } which translates to the following bytecode: public static void f(); Code: 0: dconst_0 1: dstore_0 2: dconst_0 …
Greg Peckory
  • 7,700
  • 21
  • 67
  • 114
2
votes
1 answer

Tesnor Flow unsupported opperand

I am going to use tensor flow package to run models/rnn/ptb/ ptb_worl_lm.py. However, I have got this error in seq2Seq.py, line 653, in sequence_loss_by_example log_perps /= total_size TypeError: unsupported operand type(s) for /=: 'Tensor' and…
afsaneh
  • 21
  • 4
2
votes
5 answers

Sum function prob TypeError: unsupported operand type(s) for +: 'int' and 'str'

I'm new to python (PYTHON 3.4.2) and I'm trying to make a program that adds and divides to find the average or the mean of a user's input, but I can't figure out how to add the numbers I receive. When I open the program at the command prompt it…
Nathaniel Brown
  • 61
  • 2
  • 4
  • 11
2
votes
2 answers

C operand ~and a char

I would like to know what the ~ operand does with a char. Example code: the output is -1 if var="a". int ret (char var) { int x; x=var|~var; return x; } int main() { printf("%d",ret("a")); return 0; } I dont understand why it returns…
csjr
  • 116
  • 4
  • 12
2
votes
3 answers

How to find the operand and the operation in a string

So I was trying to figure out how to detect the number of operands and operations in a mathematical expression Ex: 1+2*9/2 I was trying to separate the operands and the operations into their own form using functions because we have to check how many…
Jen
  • 55
  • 2
  • 9
2
votes
3 answers

invalid operands to binary ^ (have 'double' and 'double')

I'm rather new to coding and have been building a code to interpolate a cubic spline, but I am stuck on the last equation do the following error: _"invalid operands to binary ^ (have 'double' and 'double')|" The problem is in the last bit of the…
imacube
  • 135
  • 1
  • 1
  • 4
2
votes
1 answer

lvalue required as left operand of assignment in ios

Here is my code [[X objectAtIndex:i] doubleValue] = ([[X objectAtIndex:i-1]doubleValue] * [[X objectAtIndex:1]doubleValue]); Where X is array of double Thanks
1
vote
3 answers

Unsupported operand type?

I've got to say I am completely clueless in terms of PHP, I know enough to moderate my sites to an acceptable extent. I'm having a bit of trouble with phpauction GPL, whenever I click on one of my categories, I get this: Fatal error: Unsupported…
Dan Bell
  • 25
  • 1
  • 1
  • 2
1
vote
3 answers

assembly code embedded in c giving a improper operand type error for cmp

I have made a program that is supposed to check whether a number is positive, negative, or zero. When I try to compile the code, it gives a improper operand type error, for line 28, which is the cmp opcode. Am I formatting it wrong, or is there some…
Ryan
  • 193
  • 2
  • 2
  • 14
1
vote
1 answer

Java Error: Bad Operand Type for binary operator <

public class MaxMinArray{ private T getMin(T[] arr){ T min = arr[0]; for (int i = 0; i
noogler
  • 167
  • 1
  • 2
  • 16
1
vote
1 answer

Using list as operand

I am running into a problem when passing a list to a function. It appears to have a global effect on the list variable, but I did not declare it as global in my function. Can anyone tell me what's happening and how to work around it? def…
XisUnknown
  • 125
  • 1
  • 1
  • 10
1
vote
3 answers

error: bad operand types for binary operator '=='

Just wanted to do a task in my Book but I don't get why this is wrong.It should say that negative Numbers aren't positive and positive aren0t negative with a Boolean. This is my Code: import javax.swing.JOptionPane; public class Zahlentest { …
1
vote
2 answers

SMLNJ Insertion Sort Operator and Operand dont agree error

Im making an insertion sort code in SML, here it is fun compare(x:real, y:real, F) = F(x, y); fun isEqual(x:real, y:real) = ((x <= y) andalso (x >= y)); fun rinsert(x: real, [], F) = [x] |rinsert(x, (y::ys), F) = if isEqual(x, y) then…
small502
  • 43
  • 1
  • 5
1
vote
1 answer

Python 3.x unsupported operand type in using encode decode

I am trying to build a generic crawler for my marketing project and keep track of where the information came from viz blogs, testimonials etc. I am using Python 3.5 and Spyder/pycharm as IDE and I keep getting the following error in using encode -…
1 2
3
11 12