totoroflvff
totoroflvff totoroflvff
  • 21-01-2021
  • Computers and Technology
contestada

Print even numbers till 50 in python coding.

Respuesta :

Cytokine
Cytokine Cytokine
  • 21-01-2021

In python, you can use a simple list comprehension to solve this problem.

print([x for x in range(51) if x % 2 == 0])

This code prints all the even numbers from 0 to 50 including 0 and 50.

Answer Link

Otras preguntas

A town has a population of 4.11 x 104 and shrinks at a rate of 9.6% every year. Which equation represents the town's population after 4 years?
How long does it take to produce a star?
CAN ANYONE PLEASE HELP!’
if you have a 12 side die and a 6 side die what is the probrability it lands on 5
Los hijos son más _____ que sue padres a. altos b. alta C. alto d. altas
Definition for neutron science.
PLEASE HELP PLA Triangle ABC is similar to triangle DEF. Write the equation, in slope-intercept form of the side of triangle DEF that is parallel to BC. You mus
If you are given the two sides that are not the hypotenuse, which trigonometric function should you use?
which figures appear to be congruent A) 1,4 B) 1,4 and 5 C) 1 and 5 D) 4 and 5
Mackenzie chooses one candle and then chooses another candle. What is the probability that Mackenzie selects a polka dot candle both times?