History of Python
How Python was actually created?
Python was designed by Guido van Rossum in the 1980s. It was developed by the Python Software Foundation, and its main principle was to put an emphasis on code readability. ABC, another general-purpose programming language developed in the Netherlands, had a very heavy influence on the creation of Python. Rossum helped build ABC and expressed his positive and negative experiences with the language. He wanted to create a language that had some of the greater properties of ABC, with simple syntax and powerful data types. The idea of Python was then born and later released in 1991.
Unlike other languages such as Java and C, it doesn’t take as many lines of code to perform functionality, which is one of the reasons why it’s an easier language to learn especially for people just learning it or for new devs in general. Similar to Ruby, Python’s syntax is made up of mostly English-like commands, and that makes it more efficient as well (Ruby was actually inspired by Python!).
When should I use Python in my applications?
Python is an easy language to decipher and takes fewer lines of code in performance. It’s can be both an interpretive language as well as a compiled one, however, it’s mostly considered interpretive due to it running line by line when executing. Compiled languages, on the other hand, convert directly into machine code that the processor can then execute. The reason why this makes Python a slower language is because it’s instructions should be understood by the computer’s CPU before finally executing. In other words, Python checks if your code abides by its rules, and does that line by line which adds significantly to the overall program execution.
Some Important Python String Method:
Join() :=
x = (‘hi’ , ‘hello’, ‘howareyou’)
y = ‘ ‘.join(x)
print(y)
hi hello howareyou
Split():=
z = y.split()
print(z)
[‘hi’, ‘hello’, ‘howareyou’]
Format():=
m = “My name is {fname}, I’m {age}”
n = m.format(fname = “Viraj”, age = 21)
print(n)
“My name is Viraj, I’m 21”
Replace():=
p = “i like mango”
print(p)
‘i like mango’
q = p.replace(“mango”, “grape”)
print(q)
‘i like grape’
Strip():=
x = ‘ i like mango ‘
y = x.strip()
print(y)
i like mango