I am trying to use random functio which is mentioned in IoT/ML training of Bolt.
Following is my code:
i am not able to get the desired output which is printing the luckyNumber twice by random. Please let me know how to use while loop in random function.
For a loop you need to use indentation to write the body of the loop i.e.
<use multiple spaces or “tab”> (body of the loop)
I hope this helps.
Check the code below -
and the output -
Do let me know in case you need further assitance.
@rahul.singh1Yeah It worked.My mistake was count==0. Writing count=0 yields the result ! Hmmm…what is the difference between count==0 and count=o
@tunirkv19…I used proper indentation. However in the forum indentation has not mentioned. Neverthless count==0 will not give answer , whereas count=0 will get us the desired result! Thank you
= is assignment operator it is used to asign values to variables but == is used in comparison.
For example : if 1==1:
@rahul.singh1yes…Thank you ! I studied in college and forgot now ! Bolt forum is awesome…thanks again