DRY principle of coding : Python tutorial 66

preview_player
Показать описание
Guys please help this channel to reach 20,000 subscribers. I'll keep uploading quality content for you.

Python is easy programming language to learn and anyone can learn it, and these tutorials are 100% free in hindi.

You can share this playlist with your brother, sisters and friends. This will surely add some values to their life.

If you follow this complete playlist of python tutorial surely you will learn everything about python programming language.

This video is all about dry principle of coding

Рекомендации по теме
Комментарии
Автор

ok i got it that why your code is much better than ours.
Thanks for explanation, it is very helpfull.

sachintiwari
Автор

awesome, Your teaching method is too good.

minaxishah
Автор

Thanks alot brother...your way of understanding is so are the best ever...

abhinavtyagi
Автор

Don't know why 10 people dislike your video, your teaching is super.

sukhisingh
Автор

Thanks bro
file handling me pickle and unpickle bhi sikhao

sheikhshoaib
Автор

i think yeh sub list ke bad ana chahi tha.
but
you doing gret work.

technicalbuddyHaresh
Автор

See at 2 : 14 you can see that in number guessing game winning number is = 43 and he try two time different numer

vrgamerz
Автор

enjoyed this even though cant speak your lingo but could you please reload the code to dropbox as it is not working due to overloading

nigelblanchard
Автор

import random
win_no = random.randint(1, 100)
x=0
for i in range (1, 100):


guess_no = int(input("Enter the no."))
x +=1


if guess_no < win_no :
print('No. is less')
continue
elif guess_no > win_no :
print('No. is greater')
continue
else:
print('you win')
break

print(f'You guessed in {x} attempt')

pankajsharma
Автор

import random

a = int(input('Enter your number: '))
winning_num = random.randint(1, 100)

while a != winning_num:
print('Too high' if a > winning_num else 'Too low')
a = int(input('Enter again: '))

print('You win!')

MonkeyDLuffy-umnj
Автор

import random
winnum = random.randint(1, 100)
guess = 1
number = int(input("tell a number bettween 1 to 100 = "))
gameover = False
while not gameover:
if winnum == number:
print(f"you won you guss it in {guess} time")
gameover = True
else:
if number < winnum:
print("Too low try agian ")
guess += 1

else:
print("too high gusse agian")
guess += 1
number = int(input("tell a number bettween 1 to 100 = "))

ishaanpandey
Автор

May like this short code :


import random
Winning_number = random.randint(1, 100)
i = 0
number = 0

while number != Winning_number:
number = int(input("guess number : "))
if number<Winning_number:
print("guess too low")
elif number > Winning_number:
print("guess too high")
i +=1
print(f"you won, you have guessed the number in {i} times")

pratyushsinghrana
Автор

import random
Winning_num = random.randint(1, 100)
#print(Winning_num)
i=0
while True:
user_number = int(input("Please input your lucky number between 1 to 100 : "))
i = i +1
if user_number == Winning_num:
break
if user_number > Winning_num:
print("The number is too high")
else:
print("the number is too low")

print(f"Yaaay you guessed it right in your {i} attempt !!! Have a naice day")

PaperBackBoutique
Автор

Aoa
Sir ak problem a rhy h mry is code mn, mry code ka loop ruk nhy rha ittration chly ja rhy h. output ko rokny k ly ctrl+c press krna prta h

qamarshazad
Автор

if the user types a number close to the required number then what should be the code for saying that you are close to the desired number.... kindly help I am not getting the

tignanshumishra
Автор

import random
winning_number=random.randrange(1, 10)

for i in range(1, 5):
user_number = int(input("Enter number :"))
if winning_number==user_number:
print(f"Congratulation you win {user_number}")
break
elif user_number < winning_number:
print(f"You enterd too loo {user_number}")
continue
else:
print(f"You enterd too high {user_number}")
continue

zybi
Автор

did the code but having a problem in nested else its only showing too high what ever the input is tried 100 output too high tried 1 still output too high

lgnd_rust
Автор

If we use continue statement follow that time we use number variable after while, why?:
Wining num = 53
Guess= 1
While true:
Number = int(input("guess a number between 1to 100:")
.plz clear this doubt.

samraatadhikari
Автор

ples explain concidaretion of spacing in python

ANANTEntercom
Автор

Hi, your videos are awesome. And are very easy to u understand. But, here a logic I couldn't understand. Why, you used game over= false and what happened if you used not game over with while loop. What it says.
As I understood, game over false means not yet finished. So, please let me elaborate this logic why do we use this?

kamlendrak
visit shbcf.ru