Answer:
The modified program is as follows:
user_input = input()
short_names = list(user_input.split(" "))
short_names.pop(0)
short_names[-1] = "Joe"
print(short_names)
Explanation:
This gets the user input
user_input = input()
This converts input to list
short_names = list(user_input.split(" "))
This removes the first item of the list
short_names.pop(0)
This updates the last item to "Joe"
short_names[-1] = "Joe"
This prints the updated list
print(short_names)
Answer:
do what the directions say and you should be able to figure out the answer if not contact me through brainly
Explanation:
Functions are code segments that are executed when called or invoked
The function definition is not given; so, the output of the program cannot be outrightly determined.
However, the following are the possible scenarios.
- The program would return 35.55 if the 2 represents the digits after decimal.
- The program would return 36 if the 2 represents the significant digits.
It is unlikely for the program to return (a) 35.555 and (d) 40
Read more about functions at:
brainly.com/question/14284563
public class JavaApplication78 {
public boolean findChar(String string, String key){
if (string.contains(key)){
return true;
}
return false;
}
public static void main(String[] args) {
JavaApplication78 java = new JavaApplication78();
System.out.println(java.findChar("hello", "h"));
}
}
First I created the findChar method using the contains method. It checks to see if a certain sequence of characters is in another string. We returned the result. In our main method, we had to create a new instance of our main class so we could call our findChar method.