- 2
I confused how to write strings in function program in python
Please say anyone
3 odpowiedzi
+ 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.
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