About 210,000 results
Open links in new tab
  1. python - Concatenating values in a print statement - Stack Overflow

    Sep 10, 2016 · print "Hello ", name Notice the missing parentheses. print isn't a function that's called, it's a statement. It prints Hello Bob because the first string is and the variable separated by the comma is …

  2. python - Print Combining Strings and Numbers - Stack Overflow

    Aug 18, 2012 · To print strings and numbers in Python, is there any other way than doing something like: first = 10 second = 20 print "First number is %(first)d and second number is %(second)d" % {"first": …

  3. How to concatenate a fixed string and a variable in Python

    How to concatenate a fixed string and a variable in Python [duplicate] Asked 12 years, 4 months ago Modified 3 years, 8 months ago Viewed 334k times

  4. Concatenating string and integer in Python - Stack Overflow

    s = "string" i = 0 print (s + repr(i)) The above code snippet is written in Python 3 syntax, but the parentheses after print were always allowed (optional) until version 3 made them mandatory.

  5. How can I concatenate two integers in Python? - Stack Overflow

    How do I concatenate two integer numbers in Python? For example, given 10 and 20, I'd like a returned value of 1020.

  6. Difference between using commas, concatenation, and string …

    Feb 4, 2014 · I am learning python(2.7) on my own. I have learned that we can use the following ways to put strings and variables together in printing: x = "Hello" y = "World" By using commas: print "I am prin...

  7. How can I concatenate a string and a number in Python?

    Aug 8, 2011 · Since Python is a strongly typed language, concatenating a string and an integer, as you may do in Perl, makes no sense, because there's no defined way to "add" strings and numbers to …

  8. Concatenating strings in python without spaces - Stack Overflow

    Mar 14, 2016 · How can I print my strings so that there are no spaces between each output.

  9. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I split a …

  10. Python strings and integer concatenation - Stack Overflow

    Python strings and integer concatenation [duplicate] Asked 15 years, 7 months ago Modified 3 years, 4 months ago Viewed 812k times