Create 1.py
This commit is contained in:
24
day1/1.py
Normal file
24
day1/1.py
Normal file
@@ -0,0 +1,24 @@
|
||||
numbers = []
|
||||
rolling = []
|
||||
while True:
|
||||
a = input("")
|
||||
if a == "a":
|
||||
break
|
||||
numbers.append(a)
|
||||
print("Numbers are Inputed")
|
||||
z = 0
|
||||
while True:
|
||||
if z == len(numbers)-2:
|
||||
break
|
||||
a = int(numbers[z])+int(numbers[z+1])+int(numbers[z+2])
|
||||
rolling.append(a)
|
||||
z = z + 1
|
||||
inc = 0
|
||||
x = 0
|
||||
while True:
|
||||
if x == len(rolling)+1:
|
||||
break
|
||||
if int(rolling[x]) > int(rolling[x-1]):
|
||||
inc = inc + 1
|
||||
x = x + 1
|
||||
print(inc)
|
||||
Reference in New Issue
Block a user