Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/python
diff options
context:
space:
mode:
authorAnish Mangal <anish@sugarlabs.org>2011-02-22 22:56:40 (GMT)
committer Anish Mangal <anish@sugarlabs.org>2011-02-22 22:59:20 (GMT)
commitef3edc36c1a1c06f19823bc7b99a880c48675dfa (patch)
treee386bac518eaee9b36141aee289a08ce69452e8e /data/python
parentd29d28ba5390048d5b170cc9ca410bab50012ea8 (diff)
pep8 and pylint fixes for examples
Diffstat (limited to 'data/python')
-rw-r--r--data/python/function2
-rw-r--r--data/python/if8
-rw-r--r--data/python/interpreter2
-rw-r--r--data/python/recursion14
4 files changed, 13 insertions, 13 deletions
diff --git a/data/python/function b/data/python/function
index 18e8e91..2149c67 100644
--- a/data/python/function
+++ b/data/python/function
@@ -1,4 +1,4 @@
-def square(x):
+def square(x):
print x * x
square(3)
diff --git a/data/python/if b/data/python/if
index 6bcfbb8..0e4b947 100644
--- a/data/python/if
+++ b/data/python/if
@@ -1,8 +1,8 @@
-number = input("Enter a number: ")
+number = input('Enter a number: ')
if number > 5:
- print "Greater than 5"
+ print 'Greater than 5'
elif number < 5:
- print "Less than 5"
+ print 'Less than 5'
else:
- print "Number is 5!"
+ print 'Number is 5!'
diff --git a/data/python/interpreter b/data/python/interpreter
index dcc838e..535aaca 100644
--- a/data/python/interpreter
+++ b/data/python/interpreter
@@ -1,2 +1,2 @@
import code
-code.InteractiveConsole().interact(banner="")
+code.InteractiveConsole().interact(banner='')
diff --git a/data/python/recursion b/data/python/recursion
index c34638d..bf8cd53 100644
--- a/data/python/recursion
+++ b/data/python/recursion
@@ -1,10 +1,10 @@
-def countbackwards(number):
- print "I have the number", number
+def count_backwards(number):
+ print 'I have the number', number
if number > 0:
- print "Calling countbackwards again!"
- countbackwards(number-1)
+ print 'Calling count_backwards again!'
+ count_backwards(number - 1)
else:
- print "I am done counting"
+ print 'I am done counting'
-number = input("Enter a number: ")
-countbackwards(number)
+number = input('Enter a number: ')
+count_backwards(number)