repl.it
@SakuraKimiko/

list comprehension

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#even_num=[x for x in range(20,101) if x%2 == 0]
#print (even_num)

numbers=0
numbers in range (1,101)
count_even=0
count_odd=0
for x in numbers:
  if not  x % 2:
    count_even+1

  else:
    count_odd+1

print("There are", (count_even), "numbers")
print("There are" ,(count_odd),"numbers")