This file contains hidden or 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
def caesar_encryption(st, shift, num): | |
new = st.lower() | |
result = "" | |
if shift=='l': | |
for i in new: | |
if i.isalpha(): | |
if ord(i)-num<97: | |
result = result + chr(122-(97-(ord(i)-num) +1)) | |
else: | |
result = result + chr(ord(i)-num) |
This file contains hidden or 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 json | |
from collections import Counter | |
from bokeh.plotting import figure, show, output_file | |
with open("birthdays_1.json", "r") as f_r: | |
data = json.load(f_r) | |
l_month = [] | |
for i in data: |
This file contains hidden or 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 json | |
answer='yes' | |
while answer!='no': | |
with open("birthdays_1.json","r") as f_r: | |
data = json.load(f_r) | |
print("\n\nWe have birthdays of the following people...") | |
for i in data: |
This file contains hidden or 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
def printHang(n): | |
gal = [['---- '], | |
['| | '], | |
['| '], | |
['| '], | |
['| ']] | |
if n < 6: | |
gal[2] = ['| o '] | |
if n < 5: | |
gal[3] = ['| / '] |
This file contains hidden or 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
print ("TIC TAC TOE board. Rows and Columns starting from 1,1. Chances over after every place filled and not when someone wins.") | |
print ("Game board is printed after each chance to show progress!") | |
def print_game(game): | |
print ("\n") | |
for i in range(3): | |
print (" | ".join(str(x) for x in game[i])) | |
if i<2: | |
print("-------------") | |
This file contains hidden or 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
print ("TIC TAC TOE board. Rows and Columns starting from 1,1. Chances over after every place filled and not when someone wins.") | |
print ("Game board is printed after each chance to show progress!") | |
def print_game(game): | |
print ("\n") | |
for i in range(3): | |
print (str(game[i]) + "\n") | |
game=[[0,0,0], [0,0,0], [0,0,0]] |
This file contains hidden or 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
def guess_work(): | |
count = 0 | |
min = 0 | |
max = 101 | |
ans = "" | |
while ans!='same': | |
count+=1 | |
mid = (max + min)//2 |