# Author: <NAME>
# Date: 10/14/2020
# Purpose: This program is to replace 'is' occurance in line that the user inputs with 'was'
#          this program will run until the user inputs 'The end' phrase
# Start:
# Ask the user for an input
inputLine = input("Please write some text: ")
# The line which makes the program end
terminationLine = "The end"

# Open a while loop for when the user inputs something else other than 'The end'
while inputLine != terminationLine:
    # Replace the 'is' with the 'was'
    # If the 'is' appears in the start and is not capitalized
    if inputLine[:3] == "is ":
        inputLine = "was" + inputLine[2:]
    # If the 'is' appears in the start and is capitalized
    if inputLine[:3] == "Is ":
        inputLine = "Was" + inputLine[2:]
    # If the 'is' appears in the end
    if inputLine[-3:] == " is":
        inputLine = inputLine[:-2] + "was"
    # If the 'is' appears in the middle
    inputLine = inputLine.replace(" is ", " was ")
    # Print out the statement
    print (inputLine)
    # Ask for the input of the user again
    inputLine = input("Please write some text: ")
    
# If the user inputs 'The end'
print ("Your program has been ended!")

# Author: <NAME>
# Date: 10/14/2020
# Purpose: This program is to replace 'is' occurance in line that the user inputs with 'was'
#          this program will run until the user inputs 'The end' phrase
# Start:
# Ask the user for an input
inputLine = input("Please write some text: ")
# The line which makes the program end
terminationLine = "The end"

# Open a while loop for when the user inputs something else other than 'The end'
while inputLine != terminationLine:
    # Replace the 'is' with the 'was'
    # If the 'is' appears in the start and is not capitalized
    if inputLine[:3] == "is ":
        inputLine = "was" + inputLine[2:]
    # If the 'is' appears in the start and is capitalized
    if inputLine[:3] == "Is ":
        inputLine = "Was" + inputLine[2:]
    # If the 'is' appears in the end
    if inputLine[-3:] == " is":
        inputLine = inputLine[:-2] + "was"
    # If the 'is' appears in the middle
    inputLine = inputLine.replace(" is ", " was ")
    # Print out the statement
    print (inputLine)
    # Ask for the input of the user again
    inputLine = input("Please write some text: ")
    
# If the user inputs 'The end'
print ("Your program has been ended!")

# Author: <NAME> # Date: 10/14/2020 # Purpose: This program is to replace 'is' occurance in line that the user inputs with 'was' #          this program will run until the user inputs 'The end' phrase # Start: # Ask the user for an input # The line which makes the program end # Open a while loop for when the user inputs something else other than 'The end' # Replace the 'is' with the 'was' # If the 'is' appears in the start and is not capitalized # If the 'is' appears in the start and is capitalized # If the 'is' appears in the end # If the 'is' appears in the middle # Print out the statement # Ask for the input of the user again # If the user inputs 'The end'