-4

I keep on getting the error message "expected an indented block"

month = int(input('Please enter a month in numeric form: '))
day = int(input('Please enter a day in numeric form: '))
year = int(input('Please enter a two-digit year in numeric form: '))
if month * day == year:
print ('The date is magic!')
else:
print ('The date is not magic.')
Kevin
  • 3
  • 2

2 Answers2

0

Indent the code block inside the if statement should fix it.

month = int(input('Please enter a month in numeric form: '))
day = int(input('Please enter a day in numeric form: '))
year = int(input('Please enter a two-digit year in numeric form: '))
if month * day == year:
    print ('The date is magic!')
else:
    print ('The date is not magic.')
chepner
  • 497,756
  • 71
  • 530
  • 681
VietHTran
  • 2,233
  • 2
  • 9
  • 16
0

In Python, indentation is crucial. After each :, you must indent at least at the next line so the interpreter understands the line belongs to the block.

if month * day == year:
    print ('The date is magic!')
else:
    print ('The date is not magic.')

I suggest you to gather more information on how indents work in Python

Fukiyel
  • 1,166
  • 7
  • 19