How would you write a while loop to print all even numbers from 1-10?

i = 2while i <= 10: print(i) i += 2

CL
Answered by Chantelle L. Python tutor

1354 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

What is Object-Oriented Programming?


Write a python function that takes a string as parameter and returns the character in the string with the most occurrences, along with the number of times this character occurs


What is the difference between using range() and a list of values?


What is the difference between & and && operators?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences