About 15,700,000 results
Open links in new tab
  1. python - Why does using "from __future__ import print_function" …

    You are still using python 2 print syntax, but you imported the print function from the future (aka the print function inside python 3). It replaces the old print syntax with the new syntax, thus …

  2. printing - Print variable and a string in python - Stack Overflow

    In this case, str () is a function that takes a variable and spits out what its assigned to as a string They both yield the same print, but in two different ways.

  3. What is __future__ in Python used for and how/when to use it, and …

    Mar 2, 2016 · One of the uses which I found to be very useful is the print_function from __future__ module. In Python 2.7, I wanted chars from different print statements to be printed on same …

  4. What is 'print' in Python? - Stack Overflow

    In Python 2, print is a statement, which is a whole different kind of thing from a variable or function. Statements are not Python objects that can be passed to type(); they're just part of …

  5. How to print without a newline or space - Stack Overflow

    101 Use the Python 3-style print function for Python 2.6+ (it will also break any existing keyworded print statements in the same file).

  6. How to print function pointers with cout? - Stack Overflow

    Mar 25, 2015 · I want to print out a function pointer using cout, and found it did not work. But, it worked after I converted the function pointer to void*, so does printf with %p, such as: #include …

  7. Determine function name from within that function - Stack Overflow

    Aug 27, 2016 · If I have another function called bar, print(bar.__name__) from within foo it will not break but will report the wrong function. After all, it seems quite natural that if I have bar and …

  8. What is the difference between a statement and a function in …

    Apr 16, 2017 · So print is a statement in Python 2.7, and a function in Python 3. But I have been unable to find a straight-forward definition for the difference between a statement and a …

  9. Printing a function in Python - Stack Overflow

    Jan 15, 2013 · 7 I'm just starting to learn Python, and I'm currently reading a book that is teaching me, and in the book a function just like the one I have made below prints the actual text that is …

  10. How to print formatted string in Python3? - Stack Overflow

    Use f-strings if you just need to format something on the spot to print or create a string for other reasons, str.format() to store the template string for re-use and then interpolate values. Both …