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

please help I will really appreciate it
1 Select all the correct answers, Which two developments did the Compromise of 1850 bring about? freeing of runway enslaved people settled in the North passage
what strategies can young people use whe they experiencing rejection in job hunting ​
How do I do these two? I’m so confused-
7th grade math help me pleaseee
Geometry help please. What is the perimeter of the larger square?
Express numbers as fractionJames had 4 candy bars.He gave 1 to his friend.​
Classify this triangle by its sides and angles.
Circumfrance of a circle, (Show working)
can someone please help me​