Skip to content

Instantly share code, notes, and snippets.

@ravichandrae
Created January 25, 2018 08:38
Show Gist options
  • Save ravichandrae/7bdbad324a9e300b6c8fef151804c689 to your computer and use it in GitHub Desktop.
Save ravichandrae/7bdbad324a9e300b6c8fef151804c689 to your computer and use it in GitHub Desktop.
Comparing two different types in python
batch_size = cnf.get_batch_size()
batch = []
#Some code to fill the batch
if len(batch) == batch_size:
#Flush out the batch by saving to DB
else:
#Some other code
#The Fix here is not to forget to convert the config parameter to int
batch_size = int(cnf.get_batch_size())
num1 = "3"
num2 = 3
print(num1)
print(num2)
if num1 == num2:
print("Equal")
else:
print("Not equal")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment