Python Forum
Find the complement of a number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find the complement of a number
#5
''.join([str((int(c) ^ 1)) for c in "00111100"])

This should do it
Reply


Messages In This Thread
Find the complement of a number - by landlord1984 - Jan-19-2017, 07:50 AM
RE: Find the complement of a number - by Aquaplant - Jan-19-2017, 01:42 PM
RE: Find the complement of a number - by wavic - Jan-20-2017, 07:44 AM
RE: Find the complement of a number - by shreyaspadhye3011 - Feb-21-2020, 04:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  find the sum of a series of values that equal a number ancorte 1 518 Oct-30-2023, 05:41 AM
Last Post: Gribouillis
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,269 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  Find if chain of characters or number Frankduc 4 1,815 Feb-11-2022, 01:55 PM
Last Post: Frankduc
Question Help to find the largest int number in a file directory SalzmannNicholas 1 1,652 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  Regular expression: cannot find 1st number in a string Pavel_47 2 2,437 Jan-15-2021, 04:39 PM
Last Post: bowlofred
  Find Average of User Input Defined number of Scores DustinKlent 1 4,342 Oct-25-2019, 12:40 AM
Last Post: Larz60+
  find nearest number d3fi 7 4,000 Aug-26-2019, 09:32 PM
Last Post: ichabod801
  Find the second largest number DarkCraftPlayz 8 11,378 May-29-2019, 02:46 AM
Last Post: heiner55
  Find index of missing number parthi1705 3 3,170 May-07-2019, 10:52 AM
Last Post: avorane
  Find number in a text for if statement BitbyBit 3 3,291 Jul-13-2018, 04:38 PM
Last Post: BitbyBit

Forum Jump:

User Panel Messages

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