Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:58:12+00:00 2026-06-15T04:58:12+00:00

I just noticed something weird In python, if I do this >>> k =

  • 0

I just noticed something weird

In python, if I do this

>>> k = 1
>>> j = 2
>>> print k,",",j
1 , 2   # prints this

I expected that it would be:

1,2

Why is there a space between these two, whereas

>>> print str(k) + "," + str(j) 
1,2

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:58:13+00:00Added an answer on June 15, 2026 at 4:58 am

    The first example passes the 3 arguments to print directly, which then converts them to strings and concatenates them together, separated by spaces. The second example first converts and concatenates the string, then passes the entire string to print as a single argument. If you were to do print str(k), ",", str(j) instead, you’d get the same result as the first example.

    Think of print in terms of how functions work rather than as a keyword. As an example, take:

    def foo(*args):
        return ' '.join(map(str, args))
    

    foo('a', 'b', 'c') will pass foo 3 arguments, and then return those 3 arguments joined by spaces, 'a b c'. foo('a' + 'b' + 'c') will first create the string 'abc', then pass that as a single argument to foo, resulting in foo returning just 'abc'.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, I realize that question might seem weird, but I just noticed something that
I'm currently developing a program in python and I just noticed that something was
I just noticed something that I've never realised before. It turns out that this
I just noticed something weird in my app. I have a save button that
I just noticed something strange. If I have this XML: <level number=7 background=background_5> and
I've just started working at a new company and noticed something that looks completely
I just noticed something weird, when creating a menu for a website. Take a
NEW INFO: Something I just noticed (because this isn't something I'd normally do), but
I just noticed something strange. I thought that, as PHP's manual says, session_start() must
I'm trying to use LinqToEntities and just noticed that there are no foreign key

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.