Python buzz number

Buzz number is number, divisible by 7 or ends with 7

buzz.py

//Input number and convert it into numeric form

iNumber=int(input(“Please enter a number”))

//Check if number is divisible by 7  or last digit is 7

if iNumber%7==0 or iNumber%10==7:
  print(iNumber, ” is buzz number”)
else:
  print (iNumber,” is not a buzz number”)

Output

buzz

 

 

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.