I need someone help me in this and it should be in python Write a program that p
ID: 671909 • Letter: I
Question
I need someone help me in this and it should be in python
Write a program that prints the numbers from 1 to 100 (inclusive), one per line. However, there are three special cases where instead of printing the number, you print a message instead: If the number you would print is divisible by 3, print the message: Better three hours too soon than a minute too late. If the number you would print is divisible by 5, print the message: Where do you see yourself in five years? If the number you would print is divisible by 3 and 5, instead print out: In the future, everyone will be world-famous for 15 minutes. Here is some sample output, up to the number 22.Explanation / Answer
prompt = 'Enter a number that is divisible by 3: '
while True:
data = raw_input(prompt)
if data:
try:
number = float(data)
except ValueError:
print 'Invalid input...'
else:
if number % 3 == 0:
print 'better three hours too soon than a minute too later!'
break
else:
if number % 3 == 0:
print 'where do you see yourself in five years’
break
else
if n%3==0 or n%5==0:
print n,'in future,every one will be world famous for 15 minutes'
break