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 764631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:45:35+00:00 2026-05-14T16:45:35+00:00

I have such code in Python: def send_start(self, player): for p in self.players: player[socket].send_cmd(‘<player

  • 0

I have such code in Python:

def send_start(self, player):
    for p in self.players:
        player["socket"].send_cmd('<player id="%s" name="%s" you="%s" avatar="*.png" bank="%s" />'%(self.players.index(p)+1, p['name'], int(player["pid"]==p["pid"]), 0))
    player["socket"].send_cmd('<game playerid="%s" />'%(self.turnnow))
    player["socket"].send_cmd("<start />")

And the error is in the title of this post. What’s wrong?

  • 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-05-14T16:45:36+00:00Added an answer on May 14, 2026 at 4:45 pm

    Your code would fail if self.turnnow is an empty tuple:

    >>> var = ()
    >>> print "%s" % (var)
    Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
    TypeError: not enough arguments for format string
    >>> print "%s" % (var,)
    ()
    

    This is because a parenthesized expression in Python does not automatically become a tuple if the tuple would have only one element. (expr) is equivalent to expr. (expr, ) is equivalent to a one-element tuple holding expr as the first element. So, try adding a comma after self.turnnow in the second print statement.

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

Sidebar

Related Questions

I have the following situation in my python code: class Parent(object): def run(self): print
I have one question, I have such code this._engine = Python.CreateEngine(); ScriptSource source =
i have such code (copy paste from wiki). Its multiplication of those big numbers
I have such code: $updateSQL = UPDATE `Rooms` R SET R.Revenue = {$s['Revenue']}, R.Ave_rent
I have such code: <h:inputText id=input value=#{bean.input}> <f:convertNumber /> <rich:ajaxValidator event=onblur /> </h:inputText> I
I have such code in my JSF template: <h:form> <table id=users cellspacing=0> <a4j:repeat var=person
i have such code var prj = _dataContext.Project.FirstOrDefault(p => p.isPopular == true); if (prj
I have such code: function allValid() { $('input').each(function(index) { if(something) { return false; }
I have such code: Prelude> let n = [1,2,3,4] Prelude> n [1,2,3,4] Prelude> 0:n
I'm trying to understand how php function usort works. I have such code: <?php

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.