olverac174 olverac174
  • 20-09-2022
  • Computers and Technology
contestada

# Your task is to modify the previous examples code to
# print out all the even numbers from 1 to N where N is
# an int from the user

Your task is to modify the previous examples code to print out all the even numbers from 1 to N where N is an int from the user class=

Respuesta :

mmuiekbb
mmuiekbb mmuiekbb
  • 21-09-2022

Answer:

n = int(input('N: '))

for i in range(1, n + 1):

   if i % 2 == 0:

       print(i)

Answer Link

Otras preguntas

Use the first three triominoes to find the missing number in the fourth triomino. –7 –9 –11 –13
In addition to nationalism, which other factors led to World War I? imperialism, militarism, and entangling alliances militarism, Progressivism, and chauvinism
The state constitutional officer tasked with paying the states bills and monitoring the states financial condition is called
In one or two paragraphs, compare and contrast Billy Ansel and Mitchell Stephens. Why did the author set these two characters' sections side by side?
the 529 plan is a type of ____ plan a. grant b. scholarship c. tuition savings d. financial aid
What is the first term in a geometric sequence if the common ratio is − 2 and the sum of the first six terms is −105?
Which is the value of this expression when j=-2 and k=-1
Why did the Anti-Imperialist League argue against the U.S. occupation of the Philippines?
Fragmentation is a way to: A.develop a musical motive by making it faster. B.write a musical motive in a different key. C.create variation in a musical motive
which of the following lines has a slope of -1/2? a)x+2y=0 b)x-2y=0 c)-x+2y=0