<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
Step1:  Python for System Administrator
Author
Step2:  Basic Arithmetic
Step3:  Variable assignment
Step4:  Formatting numbers
Step5:  Formatting
Step6:  Formatting with names
<ASSISTANT_TASK:>
Python Code:
# Importing_new_features
# ..is easy. Features are collected
# in packages or modules. Just
import telnetlib  # to use a
telnetlib.Telnet  # client
# We can even import single classes
#  from a module, like
from telnetlib import Telnet
# And read the module or class docs
help(telnetlib)
help(Telnet)
# you can print with the print() function
print("Hello world!")
# concatenate string with a + sign
# and using hex notation
print("Hello" + " " + "World\x21")
print("Ciao")
# prefixing a string with 'r' disables the
# interpretation of the string content
print('Hello' * 2 + r'World\x21')
# the chr() function returns the corresponding
# character of an integer. While \n and \t are
# just the usual notation for linefeed and tab
print(chr(72) + "ello\n\tWorld!")
# triple-quoting allows multi-line strings
# %s works like in the C printf() function
# but operates on strings
# ord() is just the inverse of chr()
print(The answer is
%s
 % ord('*'))
Explanation: Python for System Administrator
Author: roberto.polli@par-tec.it
Introducing Python
Python is an interpreted, object oriented language with
a lot of built in features.
This is a fast-track course for sysadmin with knowledge
of languages like Perl, PHP, C and Java
Agenda
Importing features
Getting help
Printing 
Basic Arithmetic
Variable assignment
Formatting
End of explanation
# This is a comment, while
a = 1  # is an integer variable
b = 0x10  # is another integer in hex notation
# c = 011  # ...another one in C-style oct on python 2...
c = 0o11  # ...in python 2 and 3
# I can sum, multiply, and modulus
print(a + b, 5 % 2)
print(2 * c)
Explanation: Basic Arithmetic
End of explanation
# variable_assignment
# I can assign more than one variable on the same line
a, b, c = 1, 2, 3
d, stringa_a, stringa_b = a + b, "pippo", "pluto"
# ...swap them...
(a, b) = (b, a)  
# but if right-side values are not defined, I get an exception
e, f = c, e + d  
# We should respect reserved words and functions, like print, ord...
print(("ord:\x20", ord))
ord = 4
ord('*')  # ...ooops!
del ord  # fix it up!
ord('*')  # ...ooops!
Explanation: Variable assignment
End of explanation
## def formatting_numbers():
# bin() and hex() returns a string representation
# of a number
a, b1 = hex(10), bin(1)
# while the format() function can be more flexible
#  10 = 8ciphers + 2chars for the '0b' header
binary_with_leading_zeroes = format(1, '#010b') 
# and reversible with
b1 == int(binary_with_leading_zeroes, base=2)
Explanation: Formatting numbers
End of explanation
#def  new_formatting():
# The new str.format function just replaces
#  %s or %d with {}.
s_a = "is a string "
s_a += "that can {} extended".format("be")
# Further formatting is done using ":", eg.
#  %.6s -> {:.6}
#  %3.2d -> {:3.2}
s_a = "{} even with {:.6} formatting.\n".format(s_a, "positional")
# Alignment identifiers are simpler: < left , ^ center,  > right
s_a = "Align {:>10}% python!".format(100)
print(s_a)
print("just prints a string")
Explanation: Formatting
End of explanation
# you can name variables to get
# a better formatting experience ;)
fmt_a = "{name:<.3} {nick:^.8} {sn:>30}"
print(fmt_a.format(name="-"*10, nick="*"*15, sn="-"*40))
print(fmt_a.format(name="Roberto", nick="ioggstream", sn="Polli"))
Explanation: Formatting with names
End of explanation
<END_TASK>