Hey, I have previously programmed in C, PHP & Javascript and I have recently started out with Python but the syntax of the functions is quite different and confusing? Like if we call len(abc)
we enter the param inside the function unlike the function abc.upper()
where we use enter the param using a dot. Its kinda confusing?
itsnauman
0
Newbie Poster
Recommended Answers
Jump to PostThe dot operator is used to acces methodes and variables that are part of a class. It's saying from class abc i'm using the upper function. This function still takes it's parameters in between the brackets. You are just saying that you want to use the upper function from the …
Jump to Post>>> 'abc'.upper() 'ABC'
All 5 Replies
mathijs
0
Light Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
itsnauman
commented:
yes, but why do we enter the argument using the dot. Why not inside the brackets?
+0
itsnauman
0
Newbie Poster
mathijs
0
Light Poster
snippsat
661
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.