Write a program that asks the user for two integers that will correspond to the numbering of the first and last lines, then a third integer that will correspond to the number of z before "zigzag" (not counting the first "z" of zigzag), then finally that displays a zig-zag following the following pattern:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Python

Write a program that asks the user for two integers that will correspond to the numbering of the first and last lines, then a third integer that will correspond to the number of z before "zigzag" (not counting the first "z" of zigzag), then finally that displays a zig-zag following the following pattern:

Exemple 1:

 

Start Number: * user type 3 *

End number:   * user type 10 *

Number of z:   * user type 5 *

zzzzzzigzag 3

4 zzzzzzigzag

zzzzzzigzag 5

6 zzzzzzigzag

zzzzzzigzag 7

8 zzzzzzigzag

zzzzzzigzag 9

10 zzzzzzigzag

(Even integers must be left-zigzag and odd integers must be right.)

 

Example 2:

 

Start number:* user type -2 *

End Number:* user type 4 *

Number of z: * user type 3 *

-2 zzzzigzag

zzzzigzag -1

0 zzzzigzag

zzzzigzag 1

2 zzzzigzag

zzzzigzag 3

4 zzzzigzag

 

Example 3:

 

Start Number:* user type 5 *

End number:* user type 0 *

Number of z: * user type 10 *

(Nothing is displayed because 5>0)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,