+1 (315) 557-6473 

Create a Program to Implement Sport Printing in Python Assignment Solution.


Write a python homework program to implement sport printing.

Requirements and Specifications

program to implement sport printing in python

Source Code

# Let the user enter a sport which is going to be modified

sport = input("Please enter a sport: ")

# Let the user enter an increment, this is the spot where

# we modify the sport, assume user enters 1 and above

increment = int(input("Please enter the increment: "))

# Break the sport into list of characters, make them all lower cause that's what the requirements says

sport = list(sport.lower())

# Perform the changes to the sport

next_index = increment - 1

changes = 0

while next_index < len(sport):

# Cater to letters A to Z or a to z only

if sport[next_index].isalpha():

# Flip the case

sport[next_index] = sport[next_index].upper()

changes += 1

next_index += increment

# Put the sport back as a string

sport = "".join(sport)


print("There were " + str(changes) + " changes")