Python program: number pattern -(220313)- Digital screenprint by paulramnora

Greeting Cards & Postcards

Size:
$2.40

Python program: number pattern -(220313)- Digital screenprint by 


Sizing Information

Cards-small Cards-large Cards-postcard
Small Greeting Card Large Greeting Card Postcard
4" x 6" 5" x 7.5" 4" x 6"

Features

  • 300gsm card with a satin finish
  • Supplied with envelopes
  • Optional cellophane sleeves, ideal for reselling
  • Discount of 30% on every order of 8+ cards

DATE: Fri 22nd March 2013 13:22 PM GMT

MEDIUM: Digital printout/Windows 7 screenprint

DESCRIPTION: I went to…
http:///www.python.org
…to go downloaded the latest Python language release version 3.3 for FREE. Now, I’m trying my best to work out how to use it, most effectively. Fortunately, for me, I already went and brought myself a yearly online subscription to…
http://www.lynda.com
…so, the lesson I’m studying there is called: Python 3 Essential training…
http://www.lynda.com/Python-3-tutorials/essenti...


DISCUSSING THE PYTHON NUMBER PATTERN PROGRAM

Basically, what the program does is to first set values for the folowing 2 variables:
minNum=10
maxNum=25
…then, it uses these same 2 variables to control 3 loops; where each loop is used to create the final number pattern with.

Loop 1, gets called repeatedly by the both Loop 2/Loop3. Each time it’s called it will simply draw a straight horizontal numbers line. Eg.

1 2 3 4 5 6 7 8 9 10

…at the end of which number series, it does a vertical line break; this allows it to start again by moving one line downwards; and, also, starting flush from the left hand side margin.

Loop 2, draws the number line moving forwards by +1…

1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12 13

Loop 3, draws the number line retreating backwards by -1…

1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10

When everything gets joined up together we get the following number pattern.

1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10

…which looks like a square 10 × 10; with a triangle shaped end; somewhat resembling the top of a sharpened pencil. ;-)


PYTHON: PROGRAMMING LANGUAGE CODE

>>>
#Number pattern…

minNum=10
maxNum=26

def print_numbers(n):
for i in range(1,n):
print(i,end=’ ’)
print()

for x in range(minNum,maxNum):
print_numbers(x)

for x in range(maxNum,minNum-1,-1):
print_numbers(x)
<<<


UPDATED NAME PATTERN VERSION II

http://www.redbubble.com/people/paulramnora/wor...

NAME: Paul Ramnora
AGE: 51
LOCATION: UK/London (born/brought up/living)
INTERESTS: General Art(s), General Computing/Programming, General Education/-etc.
LEARNING DISABLITIES: ADD/Attention Deficit Disorder, AS/Aspergers Syndrome
NOTE: I’m mostly a self-taught artist. I like all arts: drawing/painting/sculpting/origami/writing/-etc.

View Full Profile


desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait

10%off for joining

the Redbubble mailing list

Receive exclusive deals and awesome artist news and content right to your inbox. Free for your convenience.