Python Forum
Credit card number redacting script
Thread Rating:
  • 4 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Credit card number redacting script
#2
As you say, index is an integer. You can't slice an integer, so index[0:13] is invalid. The only thing you have that you could do an assignment with a slice is spliced_list.

But I'm not sure how this is supposed to work. You're assigning one 'x' to a 13 long slice. I would think you would want to assign 12 x's to a 12 long slice. And your loop is just going to go through one iteration and then stop, because of the break statement. Are you planning to later put that into a conditional that finds the credit card number?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Credit card number redacting script - by Drone4four - Jan-01-2019, 06:10 PM
RE: Credit card number redacting script - by ichabod801 - Jan-01-2019, 06:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Music Python Script Repeating Number When Saving Facebook Photos ThuanyPK 2 187 May-13-2024, 10:59 PM
Last Post: ebn852_pan
  Having strange results from an RFID HID card reader - I'm stuck orbisnz 1 1,552 Mar-28-2022, 08:20 AM
Last Post: Larz60+
  SQL wild card use hammer 3 1,342 Jan-07-2022, 02:17 PM
Last Post: hammer
  Validating credit card frequency 8 4,315 Nov-05-2018, 07:36 PM
Last Post: frequency
  individual's ID card number in python danpek 2 3,828 Jun-14-2018, 04:07 PM
Last Post: DeaD_EyE
  Prime number Script Problem Codezters 4 4,128 Jul-21-2017, 03:07 AM
Last Post: Larz60+
  RAW IO disk access for SD Card shift838 1 8,646 Feb-27-2017, 03:35 AM
Last Post: Larz60+
  "Card Dealing" Python code 2.7 Paradoxalis 3 6,691 Nov-17-2016, 11:32 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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