========================================================================
PDH Try1
========================================================================
=====================================
fp = [Link](zenPython)
return(fp)
======================
import sys
import os
import io
lst = list()
fp = [Link](zenPython)
zenlines = [Link]()
zenlines = zenlines[:4]
print (zenlines)
return(zenlines)
==========================================
zenlines = [[Link]('\n'' ') for line in zenlines]
print(zenlines)
return(zenlines)
=============
import io
import re
fp = [Link](zenPython)
#Add Implementation step here
zenlines = [Link]()
newzen = [[Link]('\n'' ') for line in zenlines]
data = []
portion = []
for line in newzen:
if([Link]("--") != -1):
data = [Link]("--")
if(len(data) == 3):
[Link](data[1].strip(' '))
if([Link]("*") != -1):
data = [Link]("*")
if(len(data) == 3):
[Link](data[1].strip(' '))
return (portion)
========================================================================
PDH Try2
========================================================================
# Complete the function below.
def subst(pattern, replace_str, string):
#susbstitute pattern and return it
return [Link](pattern,replace_str,string)
def main():
addr = ['100 NORTH MAIN ROAD',
'100 BROAD ROAD APT.',
'SAROJINI DEVI ROAD',
'BROAD AVENUE ROAD']
#Create pattern Implementation here
new_address=[]
for i in addr:
new_address.append(subst(r' ROAD',' RD.',i))
return new_address
#Use subst function to replace 'ROAD' to 'RD.',Store as new_address
=========================================================================