Python, how do I make these variables integers from string

This question already has an answer here:

  • How do I parse a string to a float or int in Python? 22 answers

  • You cannot declare types in Python because Python is a dynamically typed programming language like Ruby, Smalltalk, Javascript, and many others as well. Dynamic languages have their own pros and cons, try to learn them.

    int_number = int('99') # here you go as far as casting is concerned
    
    链接地址: http://www.djcxy.com/p/48440.html

    上一篇: 如何根据传递的值添加n个输入字段?

    下一篇: Python,我如何从字符串中构造这些变量整数