Can you Coding this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you Coding this?

>>>greet('World') 'Hello, World!' >>>greet('Grok') 'Hello, Grok') >>>greet('123') 'Hello, 123'

7th Apr 2020, 7:49 PM
Abubakar Mastour Adam Fadul
Abubakar Mastour Adam Fadul - avatar
6 Answers
+ 2
greet is a function that accepts a string and returns "Hello, "+string.
7th Apr 2020, 7:55 PM
Oma Falk
Oma Falk - avatar
+ 2
print(greet("123")) but the challenge is to define greet. I wont give you the code without own effort. That's how we deal it it in SL.
7th Apr 2020, 8:07 PM
Oma Falk
Oma Falk - avatar
+ 1
I define it like this: Def greet(World, Grok, num): return 'Hello, +string' if __name__ == :__main__': But I didn't know how to print it correctly
7th Apr 2020, 8:15 PM
Abubakar Mastour Adam Fadul
Abubakar Mastour Adam Fadul - avatar
0
Can you tell me how i can print it
7th Apr 2020, 8:03 PM
Abubakar Mastour Adam Fadul
Abubakar Mastour Adam Fadul - avatar
0
so is case solved for u?
7th Apr 2020, 8:18 PM
Oma Falk
Oma Falk - avatar
0
Thanks I do appreciate this I'll close my laptop and sleep cause my head it explode from the thinking
7th Apr 2020, 8:26 PM
Abubakar Mastour Adam Fadul
Abubakar Mastour Adam Fadul - avatar