0

I am new to python and trying to execute my code. Below is my code.

   def evod(number):
    if number % 2 == 0:
        print("The number is even")
    return"The number is odd"

print(evod(60))

Output is: 
The number is even
The number is odd

if I run this function it prints both lines. It should print a single one of those. Right? Why is this happening?

Dhruv Kadia
  • 71
  • 1
  • 12

2 Answers2

1
if c=="July":
    print("7/1/2017")
else:
    print("sorry")

Indentation matters in python!

Kwahn
  • 446
  • 2
  • 12
0
if c == "July":
    print ("7/1/2017")
else:
    print ("sorry")

Correct your indentation

Nimish Bansal
  • 1,719
  • 4
  • 20
  • 37