repl.it
@SakuraKimiko/

for loops

Python

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
17
18
19
20
21
22
23
24
25
#vowels=0
#consonants=0

#for letter in "This is a sentence":
 #   if letter.lower() in "aeiou":
  #      vowels=vowels+1 
  #  elif letter =="":
  #      pass
   # else:
    #    consonants = consonants+1 
    
#print ("There are {} vowels".format(vowels))
#print ("There are {} consonants".format(consonants))

numbers=[x for x in range (20,101) if x % 2 ==0]
odd=[x for x in range(20,101) if x % 2 !=0]

for numbers in numbers:
  if numbers in range(20,101):
    numbers=numbers+1
  else:
    odd=odd
  
print ("There are {} even number.".format (numbers))
print (numbers in range (20,101))