1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
finlep [7]
2 years ago
14

Write the function greeting that takes a string as input. That string will be formatted as Name Age Hobby, without any punctuati

on. greeting should split their response into list elements, then use index values to greet them by name and respond that you enjoy that hobby as well, with the format: ‘Hello, ! I also enjoy !' Make sure your output matches this format! For example, greeting('Jose 17 hockey') # => 'Hello, Jose! I also enjoy hockey!' greeting('Cindy 14 robotics') # => 'Hello, Cindy! I also enjoy robotics!'
Computers and Technology
1 answer:
Dmitriy789 [7]2 years ago
4 0

Answer:

The function in Python is as follows:

def greetings(details):

   details = details.split(' ')

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

Explanation:

This defines the function

def greetings(details):

This splits the input string by space

   details = details.split(' ')

This prints the required output

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

After splitting, the string at index 0 represents the name while the string at index 2 represents the hobby

You might be interested in
What type of Microsoft Server serves as an email server?
Misha Larkins [42]
I have a feeling you're looking for Microsoft Outlook.
4 0
3 years ago
Read 2 more answers
URGENT!
lutik1710 [3]

<u>Explanation:</u>

Hey there! you need not to panic about it ,your program didn't have Driver program i.e main program! the correct & working code is given below:

// C++ program to count  even digits  in a given number .

#include <iostream>  

using namespace std;  

// Function to count digits

int countEven(int n)  

{  

int even_count = 0;    

while (n > 0)  

{  

 int rem = n % 10;  

 if (rem % 2 == 0)  

  even_count++;  

 n = n / 10;  

}  

cout << "Even count : "

 << even_count;  

if (even_count % 2 == 0 )  

 return 1;  

else

 return 0;  

}  

// Driver Code  

int main()  

{  

int n;  

std::cin >>n;

int t = countEven(n);  

return 0;  

}  

6 0
3 years ago
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
3 years ago
This operating system was used by individual computers and required users to type commands.
In-s [12.5K]

Answer:

MS-DOS is your answer

Explanation:

6 0
3 years ago
Which IDEs support multiple high-level programming languages? Select all that apply.
nata0808 [166]

Answer:

eclipse, xcode, and visual studio

6 0
3 years ago
Read 2 more answers
Other questions:
  • A local government uses Short Message Service (SMS) text messages to alert local residents when roads are closed. Which of the f
    13·1 answer
  • In which of the following scenarios would it be best to use a for loop?
    6·1 answer
  • Select one of the following strategies: active listening, sandwich technique, constructive feedback. in 2-5 paragraphs, define a
    11·1 answer
  • Select the term below which is a protocol that provides a method for software components to communicate, interact, and share dat
    6·1 answer
  • The four key stages with regards to data visualization workflow. Select one key stage and explain it briefly about that stage.St
    10·1 answer
  • How to write greater than or equal to in excel if function
    7·1 answer
  • Difference between ancient and modern mode of information <br> transmission
    12·1 answer
  • Please help I really need it :(
    12·1 answer
  • What impact download speeds on different computers
    13·1 answer
  • HELP PLEASE
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!