Triangle Pattern Python Code