Link to home
Start Free TrialLog in
Avatar of ReneGe
ReneGeFlag for Canada

asked on

Python syntax format: var.str() vs str(var)

Hi there,

I am new in Python.

I cannot make sense of why these formats are not just the same!

I am not arguing here.  Just trying to understand why these formats are the way they are.

Current format:
len(var)
var.upper()
str(var)
var=var[4]

Why not a standard format like for example:
len(var)
upper(var)
str(var)
middle(var,4)
SOLUTION
Avatar of Walter Ritzel
Walter Ritzel
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ReneGe

ASKER

Hi Walter and pepr,

I'm starting to get it :)

I program Windows batch files.  This is my fist efforts in object oriented programming.

Thanks guys for helping :)

Cheers,
Rene
Avatar of pepr
pepr

Hi Rene,

In my opinion, Python is an extremely good replacement for the Windows batch files. You may choose another one occasionally--based on requirements--but you will probably not regret the decision to learn Python.

Have a nice day,
Petr
Avatar of ReneGe

ASKER

Thanks pepr,
Until next time :)