I confused how to write strings in function program in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

I confused how to write strings in function program in python

Please say anyone

4th Mar 2022, 6:38 AM
GayathriVicky T
2 Answers
+ 1
Writing code in functions shouldn't differ much from writing code outside functions. From the question I have no idea what's the problem exactly, maybe you had problems with indentation.
4th Mar 2022, 7:15 AM
Seb TheS
Seb TheS - avatar
0
GayathriVicky T Looking at your profile, I see that you have just started Python, so I don't think you are learning functions just yet. I may be wrong, it is a common occurence! I think you are trying to do something like this. name = "Rik" country = 'Australia' print(name, "is from", country) Explanation: name and country are variables which hold information. Rik and Australia have quotation marks around them, which makes them strings. These strings have been assigned to the variables, so the printed output will be: Rik is from Australia
4th Mar 2022, 8:42 AM
Rik Wittkopp
Rik Wittkopp - avatar