Re: help to code...

Discussion in 'Python' started by Matteo Boscolo, May 3, 2013.

  1. The error is self expleined ..

    print str(current_month) + '/' + str(current_day) + '/' +
    str(current_year) +' *'+ *

    this line have a + at the end,the interpreter need something to add ..
    so remove it and it will work

    regards,
    Matteo

    Il 02/05/2013 15:50, leonardo selmi ha scritto:
    > dear python community,
    >
    > i wrote the following program:
    >
    > from datetime import datetime
    > now = datetime.now()
    > current_month = now.month
    > current_day = now.day
    > current_year = now.year
    > current_hour = now.hour
    > current_minute = now.minute
    > current_second = now.second
    > print str(current_month) + '/' + str(current_day) + '/' +
    > str(current_year) +' '+
    > print str(current_hour) + str(current_minute) + str(current_second)
    >
    > and i got this error:
    > Traceback (most recent call last):
    > File "runner.py", line 125, in compilecode
    > File "python", line 9
    > print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +' '+
    > ^
    > SyntaxError: invalid syntax
    >
    > how can i write the last two lines correctly?
    >
    > thanks!
    >
    >
    >
    >
     
    Matteo Boscolo, May 3, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=

    Fire Code behind code AND Javascript code associated to a Button Click Event

    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    21,241
    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=
    Feb 11, 2004
  2. Tee
    Replies:
    1
    Views:
    4,131
    Raterus
    Jun 24, 2004
  3. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: help with repeater, how to code it in code-behind page

    Phil Winstanley [Microsoft MVP ASP.NET], Jun 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    473
    Ireney Berezniak
    Jun 25, 2004
  4. keithb
    Replies:
    1
    Views:
    916
    Bruce Barker
    Mar 29, 2006
  5. tone
    Replies:
    4
    Views:
    455
    Hywel Jenkins
    Nov 19, 2003
Loading...

Share This Page