Saved Bookmarks
| 1. |
Rewrite the following Python program after removing all the syntactical errors (if any),underlining each correction.:def checkval:x = raw_input(“Enter a number”)if x % 2 = 0 :print x,”is even”else if x<0 :print x,”should be positive”else ;print x,”is odd” |
|
Answer» def checkval(): x = raw_input(“Enter a number”) if x % 2 = = 0 : print x,”is even” elif x<0 : print x,”should be positive” else : print x,”is odd” |
|