Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 5 - Loops - Programming Exercises - Page 168: 5.50

Answer

code

Work Step by Step

# 5.50 (Turtle: display numbers in a triangular pattern) Write a program that displays # numbers in a triangular pattern, as shown in Figure 5.4b. import turtle turtle.penup() turtle.goto(-170,150) turtle.pendown() for i in range(1,11): for j in range(1,i+1): turtle.write(str(j),font = ("Times", 18, "bold")) turtle.penup() turtle.forward(30) turtle.pendown() turtle.penup() turtle.goto(-170,turtle.ycor()-40) turtle.pendown() turtle.done()
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.