Why num is used in if statements in more complex checks??? | SoloLearn: Learn to code for FREE!

0

Why num is used in if statements in more complex checks???

can't we use x instead????

2/20/2017 5:30:23 AM

Naman Jain

3 Answers

New Answer

+2

it's a variable name. you could name it whatever you like.

+1

If you change the name of a variable in a script, you need to use one not still in use, and to change ALL references to it in your your script ^^ Suppose you have something like: num = 7 var = 3 user = int(input()) num = num * user * var if num == 42: print("good answer") else: print("you lost") ... you must replace 4 occurrences of the word 'num' by anything you want but not 'var' and 'user' which ared already identifier for some value ;)

0

I tries d it but no output was displayed