saltcracker
saltcracker

Reputation: 321

tuple() does not change

I'm having some problem with a tuple. Somehow the variable "verdi" stays as a tuple. I've tried adding verdi = float(input("text")) and verdi = int(input("text")) but it doesn't change. I read a few threads about the problem, but adding verdi = int(verdi) does not seem to work either. It gives the error:

TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple'

Thats where I am now:

  if valg == "1":
    print("some text goes here")
    verdi =  input("SOME TEXT: INT")
    behandler(verdi)

def behandler(*verdi):
  verdi = int(verdi)
  min = input("SOME TEXT: INT")
  maks = input("SOME TEXT: INT")

  for num in min:
    num = min

  for num in maks:
    num = maks

    if verdi > min and verdi < maks:
      -do something-
    else:
      -do something-

I get the errors at the if verdi > min and verdi < maks:

Any Ideas? :)

Upvotes: 0

Views: 74

Answers (2)

Malik Brahimi
Malik Brahimi

Reputation: 16711

* is known as the splat operator which packs an arbitrary number of arguments into a tuple, not int.

Upvotes: 1

Daniel
Daniel

Reputation: 42748

remove the asterisk:

def behandler(verdi):
    ...

Upvotes: 3

Related Questions