diff --git a/03_recursion/python/02_greet.py b/03_recursion/python/02_greet.py index 489f86d..6348ca8 100644 --- a/03_recursion/python/02_greet.py +++ b/03_recursion/python/02_greet.py @@ -1,13 +1,13 @@ def greet2(name): - print "how are you, " + name + "?" + print("how are you, ", name, "?") def bye(): - print "ok bye!" + print("ok bye!") def greet(name): - print "hello, " + name + "!" + print("hello, ", name, "!") greet2(name) - print "getting ready to say bye..." + print("getting ready to say bye...") bye() greet("adit") diff --git a/03_recursion/python/03_factorial.py b/03_recursion/python/03_factorial.py index f14e29f..861098a 100644 --- a/03_recursion/python/03_factorial.py +++ b/03_recursion/python/03_factorial.py @@ -4,4 +4,4 @@ def fact(x): else: return x * fact(x-1) -print fact(5) +print(fact(5)) diff --git a/04_quicksort/python/01_loop_sum.py b/04_quicksort/python/01_loop_sum.py index b43c5e3..32a7a04 100644 --- a/04_quicksort/python/01_loop_sum.py +++ b/04_quicksort/python/01_loop_sum.py @@ -4,4 +4,4 @@ def sum(arr): total += x return total -print sum([1, 2, 3, 4]) +print(sum([1, 2, 3, 4])) diff --git a/05_hash_tables/python/02_check_voter.py b/05_hash_tables/python/02_check_voter.py index 0b2cb02..bccdf8c 100644 --- a/05_hash_tables/python/02_check_voter.py +++ b/05_hash_tables/python/02_check_voter.py @@ -1,10 +1,10 @@ voted = {} def check_voter(name): if voted.get(name): - print "kick them out!" + print("kick them out!") else: voted[name] = True - print "let them vote!" + print("let them vote!") check_voter("tom") check_voter("mike")