Using Python External & Built In Modules

Code file as described in the video

import random
random_number = random.randint(0, 1)
# print(random_number)
rand = random.random() *100
# print(rand)
lst = ["Star Plus", "DD1", "Aaj Tak", "CodeWithHarry"]
choice = random.choice(lst)
print(choice)
  


Comments(1)

zadrain at 2019-06-23 09:30:09 says
import random n= random_number = random.randint(0,100) number_of_guesses=1 print("you have only 7 guesses") while(number_of_guesses<=7): guess_number= int(input("guess the number :\n")) if guess_number<n: print("your guess is too low like your energy.\n ") elif guess_number>n: print("your guess is too high like my energy,\n") else: print("you won \n") print(number_of_guesses,"no. of guesses you took to finsh") break print("no. of guesses left",7 - number_of_guesses) number_of_guesses +=1 if(number_of_guesses>7): print("game over\n") print("the correct no. was ",n)