✨ Second star!
Also please I'd like to die now thanks python
This commit is contained in:
parent
8702b1c28d
commit
d76639aad1
41
2020/1/report_but_its_part_two.py
Executable file
41
2020/1/report_but_its_part_two.py
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Hmm yes, pythonian
|
||||
# Oh please god no how do I make this right????
|
||||
# THERE IS SO MUCH INDENTATION FUCK
|
||||
#
|
||||
# I'm not going to take the time to fix this when
|
||||
# it's written in python lmao
|
||||
|
||||
filename = "input"
|
||||
|
||||
with open(filename, "r") as f:
|
||||
lines = f.read()
|
||||
lines = lines.split()
|
||||
|
||||
for numa in lines:
|
||||
numa = int(numa)
|
||||
|
||||
for numb in lines:
|
||||
numb = int(numb)
|
||||
|
||||
for numc in lines:
|
||||
numc = int(numc)
|
||||
|
||||
if numa + numb + numc != 2020:
|
||||
continue
|
||||
|
||||
product = numa * numb * numc
|
||||
print(numa, numb, numc, product)
|
||||
|
||||
break
|
||||
|
||||
else:
|
||||
continue
|
||||
|
||||
break
|
||||
|
||||
else:
|
||||
continue
|
||||
|
||||
break
|
Loading…
Reference in New Issue
Block a user