Posts

Showing posts from June, 2020

How to learn programming if do not have any interest in programming.

So Todays Blog is about how to learn programming if someone does not have any type interest to learn to code or facing Difficulties in learning programming. First Step If you do not want to code and have interest in any other field so just leave the field of coding and move on to another field you like, but if you like this field so be mentally prepared What is programming Not a pure definition but to explain programming is like talking with computer in a particular language like you talk in English or any other language with others . you just have to think you are communicating with the computer like example  print("hello world") in python  in this statement you just have to think you are telling computer in language python that print "hello world " you just ordering computer to act like what you decide, In this manner you have to just imagine yourself And to learn to program From where to learn You will get many YouTube videos to learn .YouTube is the Best platfor...

Never Ending Loop but when will end doesn't know program in python

Image
About the Program In this program we are going to code the simple python program with loop. But a catch is when the loop will terminate no one knows maybe never maybe in 5 minutes or maybe in 5 sec  Program import random  a = 137  print(a)  b = 0  while True:      b+=1      r=random.randint(1,10000000000)      print(str(b)+" "+str(r))      if r==a:          print(r," is succesfully founded")          break  What is happening with the code  The code is going into the loop and in loop it is taking a random number and checking with our initialized number if found it gets exit comment down the number when your loops gets exit. tip :- to execute program fast just change the    r=random.randint(1,10000000000) to     r=random.randint(1,1000)