Python Forum
How to change the datatype of list elements?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change the datatype of list elements?
#5
example:
>>>> marks=["50","60","70","80","90"]
all the elements are in string datatype. I want to change elements into integers.
Yoriz write Aug-23-2022, 03:26 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
RE: How to change the datatype of list elements? - by mHosseinDS86 - Aug-23-2022, 03:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  unable to remove all elements from list based on a condition sg_python 3 1,697 Jan-27-2024, 04:03 PM
Last Post: deanhystad
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 1,627 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  Change font in a list or tuple apffal 4 3,737 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  Checking if a string contains all or any elements of a list k1llcod3 1 4,890 Jan-29-2023, 04:34 AM
Last Post: deanhystad
  find some word in text list file and a bit change to them RolanRoll 3 2,390 Jun-27-2022, 01:36 AM
Last Post: RolanRoll
  ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements ilknurg 1 8,149 May-17-2022, 11:38 AM
Last Post: Larz60+
Question Change elements of array based on position of input data Cola_Reb 6 3,456 May-13-2022, 12:57 PM
Last Post: Cola_Reb
  datatype check arkiboys 1 1,833 Jan-18-2022, 12:46 PM
Last Post: ndc85430
  Change a list to integer so I can use IF statement buckssg 3 3,185 Sep-21-2021, 02:58 AM
Last Post: bowlofred
  change csv file into adjency list ainisyarifaah 0 1,882 Sep-21-2021, 02:49 AM
Last Post: ainisyarifaah

Forum Jump:

User Panel Messages

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