Python-Pen-Pineapple-apple-Pen

# -*- coding: utf-8 -*-
"""
Program to print pineapple pen apple pen, playing with strings and lists.
@author: mathew
"""

print("PPAP Program")

p = 'pen'
a = 'apple'

P = 'pineapple'

if 'pen' in p and 'apple' in a:
ap = [a, p]

if 'pen' in p and 'pineapple' in P:
pP = [p, P]

print(ap)
print(reversed(pP))

PPAP = (pP, ap,)

print(PPAP)

print(p)
print(a)
print(a,p)

print(p)
print(P)
print(P,p)

print(p,P,a,p)

print(a,p)
print(p,P)

print(p,P,a,p)

for string in reversed(ap):
print(string)

for string in Pp:
print(string)

for string in reversed(ap):
print(string, end='')

for string in Pp:
print(string, end='')

Thanks to Kelsey Ellison for introducing me to this earworm.

ペンパイナッポーアッポーペン

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: