r/CodingHelp • u/Killiancin • Feb 14 '26
[Python] i seriously just cannot understand this...
So I'm really new to coding, and I just cannot understand this. I am using a payed website that helps me learn with activities and stuff but I mean, if I don't understand how can I do it? I've researched this for more than 4 hours today and just cannot understand.
I do not understand DEF, what comes after it, RETURN AREA, or what comes under the #...
Could someone please explain?
93
Upvotes
View all comments
Show parent comment
2
u/Dry_Ad_1185 Feb 14 '26
In above 3 varibles are declared pi , sword_length and spear_length . Variable are like store room where you can store value while function is where you put logic . Area_of_circle is function so whenever you call that function area_of_circle() it will run that area=pie*radius*radius. In 'area_of_circle(sword_length)' value of sword length which is 1.0 will store inside radius why? beacause we defined function with radius in bracket ex. area_of_circle(radius) so its like 'area_of_circle(1.0)' for spear length its 'area_of_circle(2.0)'. Don,t worry above is bad written with variable names thats why its confusing go and learn from youtube about parameter and arguments.