I am practicing while loops and i am trying to come up with different formula that i used in for loops to do the same and i want to know if its possible to do it.
Database=["Akaki","Salome","Giorgi","Lasha","Beqa"]
x=0
for i in Database:
while x<len(Database):
x+=1
print(f"{x} {i}")
This is what I tried and answer I got is
1 Akaki
2 Akaki
3 Akaki
4 Akaki
5 Akaki
And I want to numerate it correctly with correct names in for loops. I have this formula to do it:
Database= ["Akaki","Salome","Giorgi","Lasha","Beqa"]
for i in range(len(Database)):
print(i,Database[i])
That does the job but can I do it with while loops as well?