summaryrefslogtreecommitdiff
path: root/Problem22.py
diff options
context:
space:
mode:
authorJoshua Drake <joshua.drake@ditchwitch.com>2023-04-07 08:13:49 -0500
committerJoshua Drake <joshua.drake@ditchwitch.com>2023-04-07 08:13:49 -0500
commit1161f9a034de06a63538e3a9a0b7717098c744d9 (patch)
tree55bb842b2daa4f096eb7916a8d3630426fc1c376 /Problem22.py
Initial CommitHEADmaster
Diffstat (limited to 'Problem22.py')
-rw-r--r--Problem22.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/Problem22.py b/Problem22.py
new file mode 100644
index 0000000..5684a46
--- /dev/null
+++ b/Problem22.py
@@ -0,0 +1,76 @@
+#UNFINISHED
+names = open(r"C:\Users\30720\Desktop\Programming\ProjectEuler\names.txt","r+")
+namesasstring = names.read()
+nameslist = []
+order = []
+temp = ""
+sorted = placed = False
+count,total,x = 0,0,0
+x = namesasstring.find("\"",x,len(namesasstring)) + 1
+while x < len(namesasstring):
+ y = namesasstring.find("\"",x,len(namesasstring))
+ for i in range(x,y):
+ temp = temp + namesasstring[i]
+ if namesasstring[x] == "A": nameslist.insert(0,temp)
+ elif namesasstring[x] == "B": nameslist.insert(1,temp)
+ elif namesasstring[x] == "C": nameslist.insert(2,temp)
+ elif namesasstring[x] == "D": nameslist.insert(3,temp)
+ elif namesasstring[x] == "E": nameslist.insert(4,temp)
+ elif namesasstring[x] == "F": nameslist.insert(5,temp)
+ elif namesasstring[x] == "G": nameslist.insert(6,temp)
+ elif namesasstring[x] == "H": nameslist.insert(7,temp)
+ elif namesasstring[x] == "I": nameslist.insert(8,temp)
+ elif namesasstring[x] == "J": nameslist.insert(9,temp)
+ elif namesasstring[x] == "K": nameslist.insert(10,temp)
+ elif namesasstring[x] == "L": nameslist.insert(11,temp)
+ elif namesasstring[x] == "M": nameslist.insert(12,temp)
+ elif namesasstring[x] == "N": nameslist.insert(13,temp)
+ elif namesasstring[x] == "O": nameslist.insert(14,temp)
+ elif namesasstring[x] == "P": nameslist.insert(15,temp)
+ elif namesasstring[x] == "Q": nameslist.insert(16,temp)
+ elif namesasstring[x] == "R": nameslist.insert(17,temp)
+ elif namesasstring[x] == "S": nameslist.insert(18,temp)
+ elif namesasstring[x] == "T": nameslist.insert(19,temp)
+ elif namesasstring[x] == "U": nameslist.insert(20,temp)
+ elif namesasstring[x] == "V": nameslist.insert(21,temp)
+ elif namesasstring[x] == "W": nameslist.insert(22,temp)
+ elif namesasstring[x] == "X": nameslist.insert(23,temp)
+ elif namesasstring[x] == "Y": nameslist.insert(24,temp)
+ elif namesasstring[x] == "Z": nameslist.insert(25,temp)
+
+ temp = ""
+ x = y+2
+nameslist.sort
+print(nameslist[2])
+for x in range(0,len(nameslist)):
+
+
+
+# for i in range(x,y):
+# if namesasstring[i] == "A": num=num+1
+# elif namesasstring[i] == "B": num=num+2
+# elif namesasstring[i] == "C": num=num+3
+# elif namesasstring[i] == "D": num=num+4
+# elif namesasstring[i] == "E": num=num+5
+# elif namesasstring[i] == "F": num=num+6
+# elif namesasstring[i] == "G": num=num+7
+# elif namesasstring[i] == "H": num=num+8
+# elif namesasstring[i] == "I": num=num+9
+# elif namesasstring[i] == "J": num=num+10
+# elif namesasstring[i] == "K": num=num+11
+# elif namesasstring[i] == "L": num=num+12
+# elif namesasstring[i] == "M": num=num+13
+# elif namesasstring[i] == "N": num=num+14
+# elif namesasstring[i] == "O": num=num+15
+# elif namesasstring[i] == "P": num=num+16
+# elif namesasstring[i] == "Q": num=num+17
+# elif namesasstring[i] == "R": num=num+18
+# elif namesasstring[i] == "S": num=num+19
+# elif namesasstring[i] == "T": num=num+20
+# elif namesasstring[i] == "U": num=num+21
+# elif namesasstring[i] == "V": num=num+22
+# elif namesasstring[i] == "W": num=num+23
+# elif namesasstring[i] == "X": num=num+24
+# elif namesasstring[i] == "Y": num=num+25
+# elif namesasstring[i] == "Z": num=num+26
+# total += num*count \ No newline at end of file