logo
  • Python
  • Django
  • Tools
    • Email Extractor Tool Free Online
    • Calculate Text Read Time Online
    • HTML to Markdown Converter Online
    • Other Tools
  • About
  • Contact
  • Created with Sketch.
Created with Sketch.

Last modified: Jan 10, 2023 By Alexander Williams

how to convert python list str to int

in this tutorial we'll learn how to convert a string list to int list

Table Of Contents

  • syntax
  • example

syntax

1
list(map(int, your_list)

example

1
2
3
4
5
6
7
8
#list
str_list = ['1', '2', '3', '4', '5', '6']

#convert list str to int
conv = list(map(int, str_list))

#print
print(conv)

output

[1, 2, 3, 4, 5, 6]

Related Tutorials:

  • Understanding and Using Global Variables in Python
  • [Solved] ModuleNotFoundError: No module named 'numpy'
  • Estimating Reading Time of Text and Text File using Python
  • 3 Easy Methods for Capitalizing Last Letter in String in Python
  • How To Solve no module named datasets
  • Python Get Root and Sub Domain From URL
  • Python-pycountry | Understand How to Use pycountry
  • Python: Get First, Second, Last word in String

Recent Tutorials:

  • Fix Error: Cannot Find Module in Node.js
  • Fix Error: Cannot find module './app.js'
  • Fix Error: Cannot find module '../config'
  • Fix Error: Cannot find module '../../someFile'
  • Fix Error: Cannot find module './routes/index'
  • Fix Error: Cannot find module 'pg'
  • Fix Error: Cannot find module 'mysql2'
  • Fix Error: Cannot find module 'socket.io-client'
  • Facebook
  • Twitter
  • Youtube
  • PRIVACY POLICY
  • DMCA

Copyright 2025 PyTutorial Blog Co.

Privacy Preferences

We and our partners share information on your use of this website to help improve your experience. For more information, or to opt out click the Do Not Sell My Information button below.