Hello again, Learning Python still. I came across part of the book and I can't remember reading about putting things in parenthesis and brackets. Now it is starting to show up in the tutorials and I don't want to move forward till I understand them.
Example #1 ()
while (guess != the_number):
#Can I not write that saw code like this bellow?
while guess != the_number:
Example #2 []
word = "index"
print word [1]
# the result would be n when I use it with the 'len'. why is the number surrounded by a bracket? can I write the same code like this and get the same results?
word = "index"
print word 1
Thanks,
-Lars
Example #1 ()
while (guess != the_number):
#Can I not write that saw code like this bellow?
while guess != the_number:
Example #2 []
word = "index"
print word [1]
# the result would be n when I use it with the 'len'. why is the number surrounded by a bracket? can I write the same code like this and get the same results?
word = "index"
print word 1
Thanks,
-Lars