About 1,930,000 results
Open links in new tab
  1. How to explain the int() function to a beginner - Stack Overflow

    Oct 25, 2017 · 0 Which, quite honestly, is rather insane behaviour, especially that last one. Python has a strict (er) type system; if you're trying to parse a string as an int, it must be a perfectly …

  2. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends the feature by …

  3. python - How to fix TypeError: 'int' object is not subscriptable ...

    120 When you type x = 0 that is creating a new int variable (name) and assigning a zero to it. When you type x[age1] that is trying to access the age1 'th entry, as if x were an array.

  4. python - How do I fix TypeError: 'int' object is not iterable? - Stack ...

    for number in students: your intention was, “run this block of code students times, where students is the value I just entered.” But in Python, the thing you pass to a for statement needs to be …

  5. What does Int () mean? : r/learnpython - Reddit

    integer_n = 1 floating_n = 1.0 string_n = "1" if you uses any of these variables as arguments in the int() function then it will return the equivalent integer value of that number, the float() function …

  6. What is the meaning of "int(a[::-1])" in Python? - Stack Overflow

    Jul 26, 2015 · This is some silly code, because the int() call is effectively a no-op (it doesn't do anything), because the result is converted to a string.

  7. python - How to resolve TypeError: can only concatenate str (not …

    Python working a bit differently to JavaScript for example, the value you are concatenating needs to be same type, both int or str... So for example the code below throw an error: print( "Alireza" …

  8. Python: is 'int' a type or a function? - Stack Overflow

    In Python, the types have associated functions of the same name, that coerce their argument into objects of the named type, if it can be done. So, the type int <type 'int'> has a function int …

  9. python - ValueError: invalid literal for int () with base 10 ...

    Here you are trying to convert a string into int type which is not base-10. you can convert a string into int only if it is base-10 otherwise it will throw ValueError, stating invalid literal for int () with …

  10. python - what is the difference between int (input ()) and just input ...

    May 9, 2022 · Closed 3 years ago. I am new to python, and when I use the input () for any inputs including numbers it works, but my teacher is saying to use int (input ()) for integer-based …