Skip to content

Instantly share code, notes, and snippets.

View devpruthvi's full-sized avatar
🎯
Focusing

Pruthvi Raj devpruthvi

🎯
Focusing
View GitHub Profile
import random
import string
availablewords = ['anaconda','all of me','rude','chandelier','guts over fear','maps']
punc = set(string.punctuation)
hangman = "HANGMAN"
tried = set()
def hangmangame():
again = True
while again:
alreadySaid = set(['a','e','i','o','u','A','E','I','O','U'])
<pre class="brush: jscript; title: ; notranslate" title="">
var generate = function (len, chars) {
var ret = '',
charsLen = chars.length;
while (len--) {
ret += chars[Math.floor(Math.random() * charsLen)];
}
return ret;
};
@devpruthvi
devpruthvi / Airline-Corrected.py
Last active August 29, 2015 14:07
Airline after some corrections
firstclass = [0]*8 #list that stores first class data
economyclass = [0]*8 #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')
@devpruthvi
devpruthvi / Airline Project Part 1
Created October 2, 2014 18:54
Airline Project Part 1 solution
firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data
economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')
firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data
economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')