Prerequisite:
Stacks and Queues using List | Data Structures | Python | Castor Classes
https://www.youtube.com/watch?v=bMVBW...
Python for beginners:
https://www.youtube.com/watch?v=egq7Z...
Code:
x=int(input('Enter the first digit:'));
y=int(input('Enter the second digit:'));
l=[];
q=[];
n=int(input("How many numbers you want?"));
i=0;
q.append(str(x));
q.append(str(y));
while(i<n):
es=q.pop(0);
l.append(int(es));
ex=es+str(x);
q.append(ex);
ey=es+str(y);
q.append(ey);
i=i+1;
print(l)
Code:
x=int(input('Enter the first digit:'));
y=int(input('Enter the second digit:'));
l=[];
q=[];
n=int(input("How many numbers you want?"));
i=0;
q.append(str(x));
q.append(str(y));
while(i<n):
es=q.pop(0);
l.append(int(es));
ex=es+str(x);
q.append(ex);
ey=es+str(y);
q.append(ey);
i=i+1;
print(l)
0 Comments:
Post a Comment