~doctormo/python-snippets/lp-merge-request-example

« back to all changes in this revision

Viewing changes to pythoncore/stringnumberconcat.py

  • Committer: Jono Bacon
  • Date: 2010-01-10 20:35:59 UTC
  • Revision ID: jono@ubuntu.com-20100110203559-5v29tjelodmm0fxs
Added some core Python examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
# [SNIPPET_NAME: String and number concatenation]
 
4
# [SNIPPET_CATEGORIES: Python Core]
 
5
# [SNIPPET_DESCRIPTION: Concatenate a string and a number]
 
6
# [SNIPPET_AUTHOR: Jono Bacon <jono@ubuntu.com>]
 
7
# [SNIPPET_LICENSE: GPL]
 
8
 
 
9
 
 
10
x = 1
 
11
 
 
12
print str(x) + " is a string"
 
13
print "%s is a string" % x
 
14