Resolve Issue #40: Python 2 print statements changed to use Python 3 print function (#50)

* Update 01_selection_sort.py

Updated last print statement for Python 3 print function.

* Update 01_countdown.py

Updated print statement to print function for Python 3.

* Update 05_quicksort.py

Updated print statement to print function for Python 3.

* Update 01_price_of_groceries.py

Condensed dictionary creation into one line, edited print statement to a print function for Python 3.

* Update 01_set_covering.py

Changed print statement to print function for Python 3.

* Update 01_binary_search.py

Changed print statements to print function for Python 3.
This commit is contained in:
Danh Nguyen
2018-02-03 11:15:07 -08:00
committed by Aditya Bhargava
parent a010e5c715
commit 1fa164c40e
6 changed files with 8 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ def binary_search(list, item):
return None
my_list = [1, 3, 5, 7, 9]
print binary_search(my_list, 3) # => 1
print(binary_search(my_list, 3)) # => 1
# 'None' means nil in Python. We use to indicate that the item wasn't found.
print binary_search(my_list, -1) # => None
print(binary_search(my_list, -1)) # => None