You are on page 1of 3

COLEGIO DE DAGUPAN

Arellano St., Dagupan City

Name : Sales, Andrei Justine V.


Course, Year and Block : BSIT-IV
Subject Code : ____________________________
Date : ____________________________
Name of Instructor : ____________________________

Write your solution in problem 1 below:

items = []

for i in range(1000, 3000):

s = str(i)

if (int(s[0])%2==0) and (int(s[1])%2==0) and (int(s[2])%2==0):

items.append(s)

print( ",".join(items))

1 | Page
Education is a key to success!
COLEGIO DE DAGUPAN
Arellano St., Dagupan City

Write your solution in problem 2 below:

s = input("Input a string: ")

d=l=0

for c in s:

if c.isdigit():

d=d+1

elif c.isalpha():

l=l+1

else:

pass

print("Number of Letters: ", l)

print("Number of Digits: ", d)

2 | Page
Education is a key to success!
COLEGIO DE DAGUPAN
Arellano St., Dagupan City

3 | Page
Education is a key to success!

You might also like