Python Forum
Getting false even when data exists
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting false even when data exists
#13
(May-18-2021, 05:59 PM)ibreeden Wrote: But have you tried what Perfringo suggested? In what you show us you still don't convert the user input to integer.
(May-18-2021, 01:44 PM)sriniyum Wrote: CustomerKey = input("enter the Customer Key: ")

(May-18-2021, 05:59 PM)ibreeden Wrote: But have you tried what Perfringo suggested? In what you show us you still don't convert the user input to integer.
(May-18-2021, 01:44 PM)sriniyum Wrote: CustomerKey = input("enter the Customer Key: ")

What Perfringo suggested is not working. converting to integer has no use. Please loc below. even after converting to int and then validation is failing (the customer is key is valid)

CustomerKey = int (input("enter the Customer Key: "))
print (CustomerKey)
if CustomerKey in DataFrame:
print('True')
else:
print('False')

Output: enter the Customer Key: 51108
51108
False
Reply


Messages In This Thread
Getting false even when data exists - by sriniyum - May-17-2021, 04:14 AM
RE: Getting false even when data exists - by csr - May-17-2021, 08:17 AM
RE: Getting false even when data exists - by sriniyum - May-20-2021, 03:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same rajeev1729 1 2,161 May-27-2020, 08:34 AM
Last Post: DeaD_EyE
  difference between «1 in [2] == False» and «(1 in [2]) == False» fbaldit 2 2,227 Apr-20-2020, 05:39 PM
Last Post: fbaldit
  How to insert data if not exists in mysql? farah97 0 2,821 Dec-29-2019, 08:32 AM
Last Post: farah97

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020