Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to craft a program around the following parameters: Prompt the user for a job and a number (call itincrement). Display the job in

I need to craft a program around the following parameters: Prompt the user for a job and a number (call itincrement). Display the job in lower case, but convert everyincrementcharacter to upper case. Count have many times you had to change the case of a character.

I have this so far:

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

print(job)

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

print(increment)

counter = 0

changes = 0

for ch in job:

counter = counter + 1

if counter == increment:

newch = ch.upper()

counter = 0

else:

newch = ch.lower()

if ch != newch:

changes = changes + 1

print(newch, end="")

print()

print("There were", changes, "changes")

but I am getting this error:

ACTUAL:There~were~9~changes

EXPECTED:There~were~10~changes

Any help would be appreciated

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions