Write a function that takes a passed sentence and an index and returns the sentence with the word at the index uppercased. For example, if the function takes in a sentence “I love the color red” and the index 4 it returns “I love the color RED.”

What will be an ideal response?


```
def upperWordAtIndex(source, indexUpper):
parts = source.split(" ")
newString = ""
index=0
for p in parts:
if index==indexUpper:
p = p.upper()
index = index+1
newString =newString+ p+" "
lastIndex = len(newString)-1-1
return newString[0:lastIndex]
```

Computer Science & Information Technology

You might also like to view...

Which operation cannot be completed with the use of sequential files?

a. inserting a record in the middle of a file b. deleting a record in the middle of a file c. changing the value of one field in one record in a file d. all of the above are possible

Computer Science & Information Technology

Teamwork between the law enforcement community and high-tech corporations will result in decreased reporting of criminal victimization among corporate targets

Indicate whether the statement is true or false.

Computer Science & Information Technology

Information about tables in the database is kept in the system ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Both Windows and Unix include permission flags in their file security mechanisms

a. true b. false

Computer Science & Information Technology