Goeduhub Technologies Free Online Tutorials || COVID-19 Projects(AI-ML) || Go to your University  ||  Placement Preparation  
  Register for Project Based Online Training in Artificial Intelligence(AI) & Machine Learning(ML): From 15-08-2020 || Last Batch Student's Projects

1 Answer

0 like 0 dislike
by Goeduhub's Expert (7.9k points)
selected by
 
Best answer

While Loop in Python

# Initialize variable i with value 0
i = 0
# Initialize an empty list
count = []

# Start executing the while loop untill the value of i is less than 8

while i < 8:
   print ('The number is %d' % i)
   count.append(i) # Append the value to the empty list
   i = i + 1 # Increment the value of variable i in steps of 1
   print ('The numbers in count list is:', count)

# Execute for loop using the values in count list

for numbers in count:
print ('The numbers from the count list are: %d' % numbers)

Related questions

0 like 0 dislike
4 answers 563 views
1 like 0 dislike
1 answer 40 views
1 like 0 dislike
1 answer 14 views
1 like 0 dislike
6 answers 375 views
0 like 0 dislike
1 answer 34 views
  Realize your learning potential with courses starting at ₹ 420
 Placements:   List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Online Free Training:  MACHINE LEARNINGPython Programming | Database Management System(DBMS) | Object Oriented Programming(OOPs) using C++ | Data Structures and Algorithms(DSA) | Java Programming | Linux/Unix | C Programming
Exams: List of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG) | JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
 Goeduhub
About Us | Contact Us   Social::   |  | 
...