< All Intro to Python Notes

xt0fer | Python for Security Professionals | Module 2 - Apprentice Python

By: markpepapa | Related Course: Intro to Python | Published: September 21, 2016 | Modified: September 21, 2016
Join Cybrary

NotepadFunction Call

import operator
#map function to a string
sign_dict = {'+' : operator.add, '-' : operator.sub}
x = 1
y = 2
#then we can call like this
print sign_dict[sign](x,y)

NotepadString Manipulation


Reverse string:

input = ”Hello world”

#return dlrow olleH

print input[::-1]

< All Intro to Python Notes
Join Cybrary

Our Revolution

We believe Cyber Security training should accessible for everyone, everywhere. Everyone deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is the world's largest community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

We recommend always using caution when following any link

Are you sure you want to continue?