Loop Practice Question ( DS140823 ) - 29-08-2023

Take start range and end range from user and print the count of all the even numbers.

Sample Input :
start_range : 10
end_range : 20

Sample Output :
6

Hint : because there are total 6 even values between 10 - 20

3 Likes
start=int(input("enter start"))
end=int(input("enter end"))
no=0
for i in range(start,end+1):
    if i%2==0:
        no+=1
print(no)
1 Like
start = int(input("Enter the start range:"))
stop = int(input("Enter the stop range:"))
count = 0
for i in range(start,stop+1):
    if i % 2 == 0:
      count = count + 1
print("Total count of even numbers: ",count)
1 Like
start_range = int(input("Enter the start range: "))
end_range = int(input("Enter the end range: "))

even_count = 0

for num in range(start_range, end_range + 1):
    if num % 2 == 0:
        even_count += 1

print("Count of even numbers:", even_count)
1 Like

start_value=int(input(“Enter input value”))
end_value=int(input(“enter end value”)
count=0
for i in range(star_value, end_value+1):
if i%2==0:
count+=1
print(“count of even numbers:”, count)

1 Like
start_range = int(input("Enter start range: "))
end_range = int(input("Enter end range: "))
count = 0
for i in range(start_range,end_range+1): 
    if i%2 == 0:
     count = count+1
print(count)
1 Like
start = int(input("Enter the start input number: "))
end = int(input("Enter the end input number: "))
cont=0
for input in range(start,end+1):
    if input%2==0:
        cont +=1
print(cont)   
1 Like

start_range = int(input("enter start range: "))
end_range = int(input("enter end range: "))
count_even=0
for i in range(start_range,end_range+1):
if i%2==0:
count_even = count_even+1
print(“number of even values:”,count_even)

1 Like

start_value=int(input(“enter the starting value:”))
end_value=int(input(“enter the ending value:”))
count=0
for i in range(start_value,end_value+1):
if i%2==0:
count=count+1
print(count)

1 Like
#Take start range and end range from user and print the count of all the even numbers.

#Sample Input :
#start_range : 10
#end_range : 20

#Sample Output :
#6

start = int(input('Enter the no.'))
end = int(input('Enter the no.'))
even_count = 0
for i in range(start,end+1):
   if i%2==0:
      even_count += 1
print("The count of all the even number is",even_count)
1 Like
# Take start range and end range from user and print the count of all the even numbers
    
start_no = int(input("enter start no: "))
end_no = int(input("enter end no: "))
count = 0

for i in range (start_no, end_no+1):
    if i % 2 == 0:
        count += 1
print("Count of all even numebers in b/w your numbers is: ", count)
1 Like

start=int(input(“enter the start number:”))
end=int(input(“enter the end number:”))
count=0
for i in range(start,end+1):
if i%2==0:
count+=1
print(“the count even number;”,count)

1 Like
start_range = int(input("Enter the number : "))
end_range = int(input("Enter the number : "))
count = 0

for i in range (start_range,end_range+1):
    if i % 2 == 0 :
        count+=1
print(count)

1 Like
type or paste code here
```start_range=int(input(“enter the start range :”))
   end_range=int(input(“enter the end range:”))
count=0
for i in range(start_range,end_range+1):
            if i%2==0:
                count=count+1
print(count)
1 Like

‘’’
start=int(input(“enter the first start:”))
end=int(input(“enter the second end:”))
count=0
for i in range(start,end+1):
if i%2==0:
count=count+1
print(“total count of even number:”,count)
‘’’

1 Like
start=int(input("enter your start value"))
End=int(input("enter the end value"))
for i in range (start,end+):
count=0:
if i%2==0
count=count+1
Print (count);
1 Like
start = int(input("enter start number : "))
end = int(input("enter end number : "))
count = 0
for i in range(start, end+1):
    if i%2==0:
        count += 1
print(count)
1 Like
start = int(input('Enter the no.'))
end = int(input('Enter the no.'))
even_count = 0
for i in range(start,end+1):
   if i%2==0:
      even_count += 1
print("Total count of  even number is",even_count)
1 Like
no1=int(input("Start range:"))
no2=int(input("End range:"))
no3=0

for i in range(no1,no2+1):
  if i%2==0:
    no3+=1
print(no3)

start_range = int(input('Enter the starting no. '))
end_range = int(input('Enter the ending no. '))
for i in range(start_range,end_range+1):
if i%2==0:
print('The even no. are = ',i)