Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e58080

Browse files
Create Assignment on Nested Iteration - Level 2.py
1 parent e7250ee commit 2e58080

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#lex_auth_012693813706604544157
2+
3+
def find_max(num1, num2):
4+
max_num=-1
5+
# Write your logic here
6+
list1=list(range(num1,num2+1))
7+
list2=[]
8+
if num1<num2:
9+
for i in list1:
10+
temp = i
11+
temp1 =0
12+
while temp!=0:
13+
temp1+=temp%10
14+
temp=temp//10
15+
if temp1%3==0 and i%5 ==0 and len(str(i)) == 2:
16+
list2.append(i)
17+
if(len(list2)!=0):
18+
list2.sort()
19+
max_num = list2[-1]
20+
else:
21+
max_num=-1
22+
return max_num
23+
24+
#Provide different values for num1 and num2 and test your program.
25+
max_num=find_max(10,15)
26+
print(max_num)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /