Avatar of ReneGe
ReneGe
Flag 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)
Python

Avatar of undefined
Last Comment
ReneGe

8/22/2022 - Mon
SOLUTION
Walter Ritzel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
pepr

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
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
ReneGe

ASKER
Thanks pepr,
Until next time :)
Your help has saved me hundreds of hours of internet surfing.
fblack61