To open a file in Python we use built-in open() function which accept number of arguments
open(file,mode,encoding)
With while loop we can make block of code executed as long as while statement is True
test = 0while ( test < 5): print("hello") test = test + 1
hellohellohellohello…
if Statements
To understand if statement,let see one example
name = "Prashant"if name == "Prashant": print ("Hello " + name)
As a DevOps/System Admin everyday we encounter a task where we need to interact with OS. In this tutorial I am going to tell about some important Python module which we can use for this purpose
A good programmer always tests his code before merging moving his code to production. The way to do it is by writing automated test.
Pytest is a full-featured Python testing tool which means it does everything from test collection to run the test, to give…
Tuples in python are immutable sequences of arbitrary objects,once created they cannot be changed(replaced/removed) and new elements cannot be added.
Dictionaries are unordered mapping from unique immutable keys to mutable values. Dictionaries are delimited with curly braces and contain a comma separated key-value pairs with each pair tied together by a colon.
Strings is just a sequence of characters letters,special characters,space,digits
We can use single/double quote to represent a string
>>> x = “hello”
Numbers: Python has various types of numbers