0

I'm a first time learning a language, started with python. I know it's a naive and small code, I shouldn't be asking this.

I understand there a problem with = sign, but no idea how to solve it, please help https://code.sololearn.com/czas6zskxY4l/?ref=app

10th Mar 2021, 2:43 AM
Shubham Sharma
Shubham Sharma - avatar
5 Réponses
+ 3
if rises == “East” = is assignment operator == checks if it is equals to
10th Mar 2021, 3:01 AM
Sharique Khan
Sharique Khan - avatar
+ 1
if chances is greater than 50 then print Yes here you are checking a condition if its greater than Similarly conditions can be == equals to > greater than < less than >= equal or greater than <= equal or less than but = means you are assigning a value like assigning a value to a variable name = “Shubham” here you are not checking any condition you are assigning a value thats it.
10th Mar 2021, 3:14 AM
Sharique Khan
Sharique Khan - avatar
0
Understood, thank you so much
10th Mar 2021, 3:05 AM
Shubham Sharma
Shubham Sharma - avatar
0
Sharique Khan code worked. Thanks but can you explain why this code worked chances = int(input()) if chances>50: print ("Yes") else: print("No")
10th Mar 2021, 3:10 AM
Shubham Sharma
Shubham Sharma - avatar
0
Alright, thanks again. You have been amazing. Expect few more tags as I go further learning the language.
10th Mar 2021, 3:17 AM
Shubham Sharma
Shubham Sharma - avatar