This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = open("pythonchallenge2.txt", "r") | |
l = [] | |
try: | |
for line in f: | |
for c in line: | |
if c.isalpha(): | |
l.append(c) | |
finally: | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import maketrans | |
intab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
outtab = "CDEFGHIJKLMNOPQRSTUVWXYZAB" | |
transtab = maketrans(intab, outtab) | |
mystr = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | |
mystrUpper = mystr.upper() | |
print mystrUpper.translate(transtab).lower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <ctime> | |
#include <iostream> | |
class X | |
{ | |
private: | |
std::vector<int> m_vec; | |
public: | |
X() : m_vec(100000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <string> | |
#include <iostream> | |
//Example class | |
class Dog | |
{ | |
public: | |
explicit Dog(std::string& name) : m_name(name), m_age(1){} |
NewerOlder