Python Forum
create a 20 digit string, and cast to a list then add all the digits as integers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create a 20 digit string, and cast to a list then add all the digits as integers
#3
Quote:new_digit=int(new_digit)
Try this instead:
new_digit = map(int, new_digit.split(","))
Reply


Messages In This Thread
RE: create a 20 digit string, and cast to a list then add all the digits as integers - by nilamo - Jul-19-2017, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list digit into number Voldyy 2 1,596 Jul-10-2022, 06:13 PM
Last Post: deanhystad
Question How can I create a linked list that contains each folder with its files? noahverner1995 8 2,528 Dec-25-2021, 10:46 PM
Last Post: noahverner1995
  TypeError: string indices must be integers, not str hanieh 4 98,506 Jan-04-2021, 05:13 AM
Last Post: delonbest
  Frequency in first digit from csv file, NO IMPORT bryan0901 6 2,910 May-28-2020, 09:50 AM
Last Post: bryan0901
  Sorting digits in a mixed string snorri 1 1,688 Apr-22-2020, 11:04 AM
Last Post: buran
  Convert a list of integers to strings? Cornelis 3 2,315 Nov-15-2019, 12:13 PM
Last Post: perfringo
  TypeError: string indices must be integers thecoziest 3 6,302 Sep-29-2019, 05:34 PM
Last Post: ichabod801
  Four-digit number text translation. soz 3 2,728 May-13-2019, 03:02 PM
Last Post: buran
  create three digit numbers Krszt 4 4,563 Dec-09-2018, 03:12 PM
Last Post: ThePhi
  Sum of digit in a string MEH012 1 9,544 Apr-20-2018, 02:13 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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