From 30e364f4108fc077343a8722f3d80150f0d250fe Mon Sep 17 00:00:00 2001 From: Louis Christopher Date: Sat, 21 Nov 2015 19:28:59 +0530 Subject: Fixed erroneous output stated in a comment range( start = lower limit, End is < Upper limit , Step) The upper limit is never printed. Fixed the error. --- python3.html.markdown | 1 - 1 file changed, 1 deletion(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 1f9d0e42..3ba57738 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -425,7 +425,6 @@ by step. If step is not indicated, the default value is 1. prints: 4 6 - 8 """ for i in range(4, 8, 2): print(i) -- cgit v1.2.3 From 3c4a2ff91c6d52ccc928e1c26a28e1fdcbc7c064 Mon Sep 17 00:00:00 2001 From: Louis Christopher Date: Sat, 21 Nov 2015 19:44:23 +0530 Subject: Fixed erroneous output and added a little clarity on the matter list.index(argument) would return the index of the item in the list that first matched the argument It will not return the value stored at the index of the argument as it was prior. Added some more clarity to the subject as well. --- python3.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 3ba57738..8cc03320 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -224,8 +224,8 @@ li.remove(2) # Raises a ValueError as 2 is not in the list # Insert an element at a specific index li.insert(1, 2) # li is now [1, 2, 3] again -# Get the index of the first item found -li.index(2) # => 3 +# Get the index of the first item found matching the argument +li.index(2) # => 1 li.index(4) # Raises a ValueError as 4 is not in the list # You can add lists -- cgit v1.2.3