Date and Time error


#1



File "python", line 4
print '%s/%s%s %s:%s:%s' %% (now.month, now.day now.year now.hour, now.minute, now.second)
^
SyntaxError: invalid syntax


i expect the code to print the datetime from the date first then time but in the same line.


Replace this line with your code. 
from datetime import datetime
now = datetime.now()

print '%s/%s%s %s:%s:%s' % (now.month, now.day now.year now.hour, now.minute, now.second)


#2

Well first off you are missing a / between your second and third %s


#3

Also, you need a few more commas in this section right here between now.day and now.year and now.year and now.hour


#4

thanks!!! it finally worked!!


#5

Good! I always hate when I have a good code but I don't properly format it haha. Glad it worked and happy coding! :smiley:


#6

Yeah its kinda frustrating when one can't figure out that single thing preventing the code from excecuting hahaha but when it finally runs the feeling is beyond expression hehe


#7

Yeah you work so hard on something and spend a decent amount of time on it and when it works you get those feelings of happiness successful and satisfaction all in one moment. And it can be really maddening when you just can't seem to get the answer correct! Which is why we have the forums to help each other through that! :smiley:

P.S. I will probably cry when I finish Javascript and Python honestly just with amount of time I have put into it and effort xD


#8

Oh you're also doing Javascript too!


#9

Yeah man! I am doing the Trinity of coding! (Javascript, Python, and Java) Finishing Javascript then I will go on to finishing Python and then hopefully finish Java relatively soon after that :wink:


#10

Cool man! Trinity of Coding you say~i will do Java too coz Java is in my university's curriculum i'll do it next semester~


#11

Yeah that is awesome! I will do the same when I hit college full time. My first language was Java :smiley: I really liked it but I was a real newbie at coding (still sort of am haha) and so I thought Java was the beginning course for Javascript so when I realize they were two separate languages I went on to Javascript since that was my main goal to begin with hehe.


#12

cough cough, i wouldn't quote @bibleman13 on that :wink:
but good luck with Java, that's one of my favorites, and the one i use the most! The course on here is really easy because it's not very extensive, but I think it's a good start into the language.


#13

your first was Java? mine was html then C...now am learning python and then begin Java from Spring Semester^^


#14

Ok so the "trinity of coding" is not a real thing @peace2121 I just made it up but gosh @kyleaw just bursting my little bubble here :stuck_out_tongue: And yeah well like I said @peace2121 I was a real newbie so I didn't go about it in a very organized fashion and I had wrong thoughts about how things were lined up (like Java being a beginner course for Javascript) so I sortof started several languages before I settled down and starting a more structured learning path haha what you have done sounds much better than what I started with so props to you on that!


#15

hahaha the trinity of coding though it ain't real it still sounds cool hahaha actually i kinda like it and will use it from now hehehe


#16

Well when you become a famous coding person just remember poor ole bibleman13 and his trinity :stuck_out_tongue: anyhow! It has been great talking with ya and I wish ya luck on all future coding adventures. If you need anymore help on codecademy you know where to go ! :smiley:


#17

Sure i will not forget you @bibleman13 you're the first person i got assistance from when i got stuck in coding while learning python! thanks so much and good luck in your coding activities in the future!


#29