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

1415 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

What is the difference between DFS and BFS? Where can I apply each?


Creating string from multiple strings(or characters)


Write a program that computes the sum of all numbers up to a input number n


Write a program that takes a value x and then outputs x Fibonnaci numbers. E.g. if x=6 output would be 1 1 2 3 5 8


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences