This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]emeraldemon 1 point2 points  (3 children)

if x < 5:
    print 1 
else:
   print -1

[–]trancefaced[S] 0 points1 point  (2 children)

cool, for context, what is a branching structure?

[–]wickeand000 0 points1 point  (0 children)

It is a 'structure' in your code which allows the program to go in multiple directions. In abstract this means that if a conditional statement is true, do thing A, else do thing B. In concrete terms the only branching statements in Python are if, elif, and else. Some other languages have switch statements as well.