Thursday, June 5, 2014

Day 61

Explored Python at CodeCademy. Worked on Python tutorial 14 of 16, Strings & Console Output, String Formatting with %, Part 1. Learned how to print a variable with a string without concatenating strings together.

The code used:
string_1 = "Camelot"
string_2 = "place"
print "Let's not go to %s. 'Tis a silly %s." % (string_1, string_2)

The interaction looked like this:
Let's not go to Camelot. 'Tis a silly place.

No comments:

Post a Comment