Very noob question


Thank you for taking time to help me!

Doesn't make a string

It should make pirate a string

Replace this line with your code. 
# Write your code below, starting on line
print len(my_string)
print my_string.upper()

I know I could use quotation marks instead of str(), but I want to understand what str() is used for exactly since it doesn't seem to create a string in this problem.

I am also stuck on this

from datetime import datetime
now =
print '%s-%s-%s' % (, now.month, now.year)

It seems I can't make / a string/variable of -

I thought adding a \ before hand would fix it, but it doesn't. What is the correct script for this problem?


To address the first portion of your question, the str() method is a form of typecasting. It allows you to convert other data types into a String. When you did str(pirate), Python considers pirate a variable that it cannot find. You should only use str() when dealing with other data types and create strings through quotation marks.

For the second part, all the program is asking you to do is replace the '-' with a '/'. Just simply delete the dash(-) and replace it with the forward slash(/). Hope this helps.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.