Answers for "else with for in python"

3

how to use if else in python

print("Welcome to Rolercoster rider")
print()
#taking input of your hight
Your_hight = int(input("What is Your hight:- "))
#if condition 
if Your_hight >= 120:
    print("You are good to go to the roller coster")
else:
    print("Grow taller to go to the rolercoster")
Posted by: Guest on July-31-2021
1

python for/else

for n in range(2, 10):
    for x in range(2, n):
        if n % x == 0:
            print( n, 'equals', x, '*', n/x)
            break
    else:
        # loop fell through without finding a factor
        print(n, 'is a prime number')
Posted by: Guest on July-22-2021
0

for-else in python

numbers = [2, 4, 6, 8, 1]
for number in numbers:    
  if number % 2 == 1:        
    print(number)        
    break
else:    
  print("No odd numbers")
Posted by: Guest on May-11-2021
0

else if in pyton

elif():
Posted by: Guest on July-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language