Q) neighbours m and n order takeout on new year's. after this, they order at a fixed interval. write a python program to find out the number of days both will order on the same day in january.
for example: if m orders every 2 days after jan 1st and n orders every 3 days after jan 1st, the number of times they order on same day is 6 (include jan 1st)
I tried this.
c1 and c2 in the while loop will give the days on which they ordered takeout. I was planning to add all the values of c1 and c2 to two separate lists and compare them?? i'm not sure if that's possible, and if it is this is wrong code. I'm not sure how to do this. please someone help
m=int(input())
n=int(input())
c1=1
c2=1
count=0
while c1 in range(1,31):
c1=c1+m
l1=[1,c1]
while c2 in range(1,31):
c2=c2+n
l2=[1,c2]
for x in l1:
for y in l2:
if x==y:
count=count+1
print(count)