Q:

If : (Why is there no value assigned?)

Can anybody tell why is there no value assigned to begin after the condition at if begin: and just end with a colon instead? May I know what does it mean?
if begin:
    begin = int(begin)
    end = int(raw_input("End:"))
    print "word[", begin,":",end,"] ",
    print word[begin:end]

raw_input("\n\nPress the Enter Key to exit.") 

Thank You! 

A:

I tried the following snipped and it worked.
Code:
word = "PythonWizard"
print word
begin = int(raw_input("Begin:"))
if begin:
    begin = int(begin)
    end = int(raw_input("End:"))
    print "word[", begin,":",end,"] ",
    print word[begin:end]

raw_input("\n\nPress the Enter Key to exit.") 

Output:

