YouTip LogoYouTip

Python Exercise Example36

# Python2.x Python Exercise Instance 36 [![Image 3: Python 100 Examples](#) Python 100 Examples](#) **Title:** Find prime numbers within 100. **Program Analysis:** None. Program source code: ## Instance #!/usr/bin/python# -*- coding: UTF-8 -*-# Output primes within the specified range# User inputs data lower = int(input("Input the minimum value of the interval: "))upper = int(input("Input the maximum value of the interval: "))for num in range(lower,upper + 1): # Prime greater than 1 if num>1: for i in range(2,num): if(num % i) == 0: break else: print(num) The output result of the above instance is: Input the minimum value of the interval: 1Input the maximum value of the interval: 1002357111317192329313741434753596167717379838997 [![Image 4: Python 100 Examples](#) Python 100 Examples](http://
← Python Exercise Example37Python Exercise Example35 β†’