Created
February 26, 2016 02:35
-
-
Save LottieVixen/afa22925d2a45df70eb4 to your computer and use it in GitHub Desktop.
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
import timing | |
class leaveloop( Exception ): | |
pass | |
checkString = 'abcdefghijklmnopqrstuvwxyz' | |
password = 'te' | |
testingString = '' | |
try: | |
for c in checkString: | |
for d in checkString: | |
testingString = c + d | |
if password == testingString: | |
print('yes its',testingString) | |
raise leaveloop | |
print(testingString) | |
except leaveloop: | |
pass |
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
import timing | |
class leaveloop( Exception ): | |
pass | |
checkString = 'abcdefghijklmnopqrstuvwxyz' | |
password = 'test' | |
testingString = '' | |
try: | |
for c in checkString: | |
for d in checkString: | |
for e in checkString: | |
for f in checkString: | |
testingString = c + d + e + f | |
if password == testingString: | |
print('yes its',testingString) | |
raise leaveloop | |
print(testingString) | |
except leaveloop: | |
pass |
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
import timing | |
class leaveloop( Exception ): | |
pass | |
checkString = 'abcdefghijklmnopqrstuvwxyz' | |
password = 'atests' | |
testingString = '' | |
try: | |
for c in checkString: | |
for d in checkString: | |
for e in checkString: | |
for f in checkString: | |
for g in checkString: | |
for h in checkString: | |
testingString = c + d + e + f + g + h | |
if password == testingString: | |
print('yes its',testingString) | |
raise leaveloop | |
print(testingString) | |
except leaveloop: | |
pass |
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
import math | |
text = "(CNN)Pope Francis suggested that contraceptives may be used to prevent the spread of the Zika virus, despite the church's longstanding ban on most forms of birth control. His comments may cheer health officials in Latin America but are likely to upset conservative Catholics. At a press conference aboard a flight from Mexico to Rome on Thursday, the Pope was asked whether the church should consider contraception the \"lesser of two evils\" compared with the possibility of women aborting fetuses infected with Zika. The virus has been linked to an incurable and often devastating neurological birth defect. The Pope first answered by calling abortion an \"absolute evil\" and a \"crime.\" Zika tests Catholic position on birth control Zika tests Catholic position on birth control \"It is to kill someone in order to save another. This is what the Mafia does,\" Francis said. \"On the other hand, avoiding pregnancy is not an absolute evil.\" The Pope then pointed to a narrow historical exception to the church's ban on most forms of birth control: A predecessor, Pope Paul VI, allowed African nuns to use contraceptives \"in cases of rape,\" Francis said. \"In certain cases ... such as the one I mentioned of Blessed Paul VI, it was clear,\" the Pope said. Paul VI also wrote \"Humanae Vitae,\" the papal document that solidified the church's stance against almost every form of birth control in 1968 Francis was likely referring to nuns in the Belgian Congo during the 1960s, who used anovulant, a form of contraception that prevents ovulation. They did so to avoid the possibility of becoming pregnant by rape, a threat during the country's political upheaval. How is the Zika virus spread through sex? Dr. Sanjay Gupta answers questions about the Zika virus \"There was a legitimation of contraception at the time, and I think he's saying that a similar situation now exists in countries where the Zika virus is prevalent,\" said the Rev. James Keenan, an expert on Catholic sexual ethics and morality. Keenan said the Pope's comments, although made in an off-the-cuff interview and not an official papal document, could have broad implications for health care providers, not only in Latin America but also the United States and elsewhere. \"This is not just about individuals. This is about the thousands of Catholic hospitals that can help women in this situation\" by providing contraception. Keenan compared the Pope's comments to remarks made by his predecessor, Pope Emeritus Benedict XVI, in 2010. In a book-length interview, Benedict said that in some cases, using condoms to prevent the spread of disease could be the \"first step\" toward moral responsibility. Francis' comments on Thursday take that argument several steps farther, Keenan said. Read next: Pope suggests Trump 'is not Christian' A fierce debate Aline Kalbian, professor of religion at Florida State University who has studied the Catholic Church's contraception ban, said the Pope's comments on Thursday surprised her. They countered the dominant view of Vatican officials for decades: the church allowed no exceptions. \"He seems to be really clear that this is an exception and he's going to allow it.\" The church does allow natural family planning, which involves a woman monitoring her basal body temperature and vaginal secretions to avoid having sex at fertile times of the month. It's not entirely clear what the chances are that a pregnant woman who contracts Zika will have a baby with microcephaly. Babies with the defect have small heads and abnormal brain growth and often have developmental delays, seizures, problems with movement and speech and other issues. First known sexual transmission of Zika virus in U.S. was eight years ago First known sexual transmission of Zika in U.S. was '08 On Thursday, the World Health Organization called for access to emergency contraception and counseling for women who \"have had unprotected sex and do not wish to become pregnant because of concern with infection with Zika virus.\" As in the United States, many Catholics in Latin America don't follow the church's advice on birth control anyway. According to a survey by the Spanish-language television network Univision, 88% of Mexicans, 91% of Colombians and 93% of Brazilians support the use of contraceptives. But the Catholic catechism states that aside from natural family planning, anything that works to \"'render procreation impossible' is intrinsically evil.\" The church's teachings have put women in Latin America, where a majority of people are Catholic, in a difficult situation. In December, authorities in Brazil urged women not to get pregnant. Then last month came the warning from Colombia to delay pregnancy until July. Then in an interview, a health official in El Salvador recommended that women \"try to avoid getting pregnant this year and the next.\" The Rev. John Paris, a bioethicist and Catholic priest at Boston College, said Pope Francis is primarily a pastor, not a systematic theologian interested in abstract ideas. In contrast to previous popes, Francis formed his style of ministry in the slums of South America, not European seminaries. Zika virus outbreak 22 photos: Zika virus outbreak \"He's a pastor and he's concerned with the plight of people in all their human dimensions,\" Paris. \"And Zika is a problem that's suddenly confronting the world and just to repeat past abstract theories doesn't help resolve the question.\" But the Pope's comments appear to put him at odds with some Catholic leaders in Latin America. \"Contraceptives are not a solution,\" Bishop Leonardo Ulrich Steiner, the secretary general of the National Council of Bishops of Brazil, said in an interview earlier this month. \"There is not a single change in the church's position.\" And a Catholic priest in Salvador told Catholic News Service that \"If someone asks me for advice, I would say that the important thing is to get rid of the larvae, but I can't say do not get pregnant.\" The Rev. Frank Pavone, national director of Priests for Life, has said that birth control is wrong, no matter what. \"That prohibition doesn't change based on circumstances,\" he said. \"So couples have a responsibility to live according to the church's teachings in whatever circumstances they find themselves.\" The practical effect of papal comments Will the Pope's remarks on Thursday really matter? \"I don't know that it will,\" Kalbian said. \"Most Catholics have ignored Vatican teachings on this particular issue.\" But Kalbian, author of \"Sex, Violence, Justice: Contraception and the Catholic Church,\" says Francis' comments could have a ripple effect on church teaching. She said the Catholic Church teaches that every act of intercourse should be open to conception. If the Pope is now saying it's acceptable not to be open to conception in the Zika situation, what other situations would it be okay to be not open to conception? For example, if pregnancy could threaten the life of the mother, is it okay to use birth control? What if a couple is at an increased risk of having a baby with some genetic defect? \"I think they're going to have to answer these questions,\" Kalbian said of the Vatican. Read more: 5 things you need to know about Zika" | |
text = text.lower() | |
counter = 0 | |
totalchar = 0 | |
count = {'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,'j':0,'k':0,'l':0,'m':0,'n':0,'n':0,'o':0,'p':0,'q':0,'r':0,'s':0,'t':0,'u':0,'v':0,'w':0,'x':0,'y':0,'z':0} | |
while counter < len(text): | |
if text[counter] in count: | |
count[text[counter]] = count[text[counter]] + 1 | |
print(text[counter]) | |
totalchar = totalchar + 1 | |
counter = counter + 1 | |
print("*** NUMERICAL ***") | |
for x in 'abcdefghijklmnopqrstuvwxyz': | |
print(x,"|",(count[x]/totalchar)*100) | |
print(" | *** GRAPHICAL ***") | |
for x in 'abcdefghijklmnopqrstuvwxyz': | |
print(x,"|",'*'*math.floor((count[x]/totalchar)*200)) |
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
import atexit | |
from time import clock | |
line = "="*40 | |
def log(s, elapsed=None): | |
print(line) | |
print(clock(), '-', s) | |
if elapsed: | |
print("Elapsed time (s):", elapsed) | |
print("(ms):", elapsed*1000) | |
print(line) | |
print() | |
def endlog(): | |
end = clock() | |
elapsed = end-start | |
log("End Program", elapsed) | |
def now(): | |
return clock() | |
start = clock() | |
atexit.register(endlog) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment