About 151,000 results
Open links in new tab
  1. printing - Print variable and a string in python - Stack Overflow

    48 If you are using python 3.6 and newer then you can use f-strings to do the task like this. print(f"I have {card.price}") just include f in front of your string and add the variable inside curly …

  2. python - Concatenating values in a print statement - Stack Overflow

    Sep 10, 2016 · The reason why it's printing unexpectedly is because in Python 2.x, print is a statement, not function, and the parentheses and space are creating a tuple. Print can take …

  3. python - What is print (f"...") - Stack Overflow

    Jul 22, 2019 · I am reading through a python script that takes an input of XML files and outputs an XML file. However, I do not understand the printing syntax. Can someone please explain what …

  4. python - How can I print multiple things (fixed text and/or variable ...

    See also: How can I print multiple things on the same line, one at a time? ; How do I put a variable’s value inside a string (interpolate it into the string)?

  5. What is the difference between an expression and a statement in …

    Jan 19, 2011 · A statement consists of pretty much anything you can do in Python: calculating a value, assigning a value, deleting a variable, printing a value, returning from a function, raising …

  6. How the '\\n' symbol works in python - Stack Overflow

    Can someone explain how the '\n' works outside the print function and yet my standard output knows to get a new line? Also what is the meaning of the comma symbols in the first …

  7. Python: % operator in print() statement - Stack Overflow

    Dec 8, 2013 · Intro The % operator in python for strings is used for something called string substitution. String and Unicode objects have one unique built-in operation: the % operator …

  8. What is the difference between print and print() in python 2.7

    Nov 30, 2015 · In Python 3 and higher, print() is a normal function as any other (so print(2, 3) prints "2 3" and print 2, 3 is a syntax error). If you want to have that in Python 2.7, put from …

  9. python - 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.

  10. python - Print full ascii art - Stack Overflow

    May 13, 2014 · print() function expects a text, not bytes (unrelated: to print bytes, you could use sys.stdout.buffer.write(some_bytes)) how bytes are interpreted as a text is the property of your …