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

which instrument is best suited for measuring the dimensions of a shoebox? a)a triple-beam balance b)a volumetric flask c)a ruler d)a caliper
What are the verbs in each sentence
Doctors of chiropractic receive much less training than a medical doctor or doctor of osteopathy. True or false?
What is one reason Thomas Paine believes that the youth had an advantage against Britain
A wheel made 308 revolutions at 26 and 1/8 revolutions per minute. How many minutes did it​ rotate?
How many moles of MgS2O3 are in 213 g of the compound?
1. The _________ of a wave is the density of the medium’s particles at the compression of the wave. 2. In which part of the wave are the particles of the medium
How many moles are in 25 grams of HF
what number best completes both equations 2/3÷3/10=? ?×3/10=2/3
As altitude increases, the air pressure _____?