< 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 be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free 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.

Support Cybrary

Donate Here to Get This Month's Donor Badge


We recommend always using caution when following any link

Are you sure you want to continue?