week 4 & week 5

mail@pastecode.io avatar
unknown
python
a year ago
838 B
3
Indexable
Never
WEEK 4 
TASK 2
a = str(input())
print(a[-1])

TASK 4
date=str(input())
print(date[0:4])
print(date[5:7])
print(date[8:10])

TASK 6
a=str(input())
k=int(len(a)/2)
print(a[0:k:1])

TASK 8
a = str(input())
o = a[::-1]
if a==o:
    print('YES')
else:
    print('NO')
    
WEEK 5
TASK 2
a = input()
x = [int(i) for i in a ]
summ = []
s = 0
for i in x:
    s = s + i
    summ.append(s)
print(summ) 

TASK 6
list = []
a = input()
while a != '.':
    list.append(int(a))
    a = input()
print(list) 
TASK 7
list = []
list2=[]
a = input()
while a != '.':
    list.append(int(a))
    a = input()
list2.append(max(list))
list.remove(max(list))
for i in list:
 list2.append(i)
print(list2)
TASK 8
TASK 10
a = int(input())
for i in range(a):
    print(['#' for i in range(a)])
TASK 12