Python Practice 2 Solution | Python Tutorials For Absolute Beginners In Hindi #106

preview_player
Показать описание


Best Hindi Videos For Learning Programming:

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

try:
n = int(input("How many apples does harry got?"))
mn = int(input("What is the lowest value?"))
mx = int(input("What is the last value?"))
if mn == mx:
print("plese check the values this cant be done")
while (mn <= mx):
if n % mn ==0:
print(f"{mn} is a divisor of {n}")
else:
print(f"{mn} is not a divisor of {n}")
mn = mn+1
except:
print("Invalid entry")

aswin
Автор

Pata nahi yeh comment aab dekhenge ki nahi but bhai aap ko ye bolna chahta hu very very thank you for your great initiative aapke videos se mai python sikha thank you so much ...

regarding code ye raha code :-

Dividor=int(input("ENTER THE NUMBERS OF APPLES: "))
min=int(input("ENTER THE MINIMUN NUMBER OF STUDENTS: "))
max=int(input("ENTER THE MAXIMUM NUMBER OS STUDENTS: "))
ls=[]
ks=[]
for i in range(min, max+1):
if(i%2==0):
ls.append(i)
else:
ks.append(i)

print(f"the number is divisible are {ls}")
print(f"the number is not divisible are {ks}")

hrittikkumartanti
Автор

try:

apples = int(input("Enter the number of apples\n"))
mn = int(input("Enter the maximum number of apples\n"))
mx = int(input("Enter the minimum number of apples\n"))

except ValueError:
print("Please enter a correct value")
exit()

if mn>=mx:
print('minimum cannot become greater than maximum')

for i in range(mn, mx+1):
if apples%i == 0:
print(f'{i} is a divisior of {apples} ')
else:
print(f'{i} is not a divisor of {apples}')

dhairyachavand
Автор

while True:
try:
n=int(input("Enter the value of apples you have :"))
mins=int(input("Enter the min value of apples :"))
maxs = int(input("Enter the max value of apples :"))
for i in range(mins, maxs+1):
if n%i == 0:
print(f"{i} is a divisor of {n}")
else :
print(f"{i} is not a divisor of {n}")
except:
print("invalid input")

ritiksinghania
Автор

Hello harry bhaai...
i solved with while loop... please check

n = int(input("Enter the number of apples Harry got :- "))
print(f"\t\tHarry has {n} apples")
mn = int(input("Enter the minimum number of students :- "))
mx = int(input("Enter the maximum number of students :- "))


while (mn<=mx):
if n%mn ==0:
print(f"{n} divisible by {mn} so apples can distributed equally")
else:
print(f"{n} is not divisible by {mn} so can't distribute apples equally to each student")
mn=mn+1

MedRep_Adventures
Автор

try:
n = int(input("Enter then No.of apple Harry is got: "))
mn= int(input("Enter the Minimum No.: "))
mx= int(input("Enter the Maximum No.: "))
except ValueError:
print('Enter the Integer Only!!')
exit()
if mn > mx:
print("This can not be the range as the mn should be less than mx")

for i in range(mn, mx+1):
if (n % i == 0):
print(f"{i} is divisible by {n}")

elif mn == mx:
print("This is not a range, and mn is equal to mx.")
print(f"{i} is divisible by {n}")

else:
print(f"{i} is not divisible by {n}")

chiranjeevsharma
Автор

try:
n=int(input("input the number of apples which Harry will get"))
mn=int(input("enter minimum range"))
mx=int(input("enter maximum range"))
except Exception as e:
print(e)
exit()

if mn==mx:
print(f"both mn and mx are same: {mn}")
if n%mn==0:
print(f"{mn} is a divisor of {n}")
while mn<=mx:
if n%mn == 0:
print(f"the number {mn} is divisor of {n}")
else:
print(f"the number {mn} is not a divisor of {n}")
mn=mn+1

artigupta
Автор

while True:
try:
apples = int(input("Apples - "))
minn = int(input("Minn - "))
maxn = int(input("Maxn - "))
if minn < maxn:
n = []
n1 = []
for i in range(minn, maxn + 1):
if apples % i == 0:
n1.append(i)
else:
n.append(i)
print(f"{n1} is a divisor")
print(f"{n} not a divisor")
break
else:
print("Minn should be smaller than Maxn")
except ValueError:
print("Enter valid input")

gokugohan
Автор

n= int(input('Enter the number of apples'))
mn= int(input('Enter the minimum number of apples'))
mx = int(input('Enter the maximumm number of apples'))

y=range(mn, mx+1)

for items in y:
if n%items ==0:
print(f'{n} is divisible by {items}')
else:
print(f'{n} is not divisible by {items}')

ratulmondal
Автор

print("There are 50 students in the class")
try:
n=int(input("Enter the the number of apples avaliable\n"))
mn=int(input("Minimun number of apples a student can get\n"))
mx=int(input("Maximum amount of apples a student can get\n"))
except ValueError:
print("Please enter a numerical value")
exit()

for i in range(mn, mx):
if n%i==0:
print(f"{i} is the divisor of {n} & each student will get {n/i} apples")
elif n%i!=0:
print(f"{i} is not a divisor of{n}")
elif mn==mx:
print("This is not a range and minimum and maximum apples are equal")
else:
pass

smitbhandari
Автор

Sir aapne bahut jaldi solution de Diya agli baar Mae jarur solve karunga

skpandeyg
Автор

n=int(input("enter value of n:"))
mn=int(input("enter value of mn:"))
mx=int(input("enter value of mx:"))
if mn==mx:
if(n%mn==0):
print(f"{mn} is divisor of {n}")
print("this is not a range")
else:
while(mn<=mx):
if(n%mn==0):
print(f"{mn} is divisor of {n}")
else:
print(f"{mn} is not a divisor of {n}")
mn=mn+1

shivamg
Автор

while True:
try:
a=int(input("Enter apples"))
b=int(input("Enter minimum"))
c=int(input("Enter maximum"))
if b==c:
print(f'b and c is equal ')
continue
break
except Exception as e:
print(f'pleese enter a number')
continue


for i in range(b, c+1):
if a%i == 0:
print(f'{i} is divisor {a}')
else:
print(f'{i} is not divisor {a}')

rohannikale
Автор

print("Enter the numbers of apples prince is got")
apple = int(input())
list_apple = [apple]
# print(list_apple)
print("Enter the minimum number")
minimum = int(input())
print("Enter the maximum number ")
maximum = int(input())

for i in range(minimum, maximum + 1):
if minimum == maximum:
print("This is not a divisor range")
if apple%i == 0:
print(f"{i} is divisor number of {apple}")
if apple%i >= 1:
print(f"{i} is not divisor number of {apple}")

OTPRINCE
Автор

try:
n=int(input("Enter the apples Harry has gotten:-"))
mn=int(input("Enter minimum range: "))
mx=int(input("Enter maximum range: "))
except ValueError:
print("Invalid input, Try again!!!")
exit()

for i in range(mn, mx+1):
a=n%i
if mn==mx:
print("this is not the range")

if a==0:
print(f"{i} is divisible by {n}")
else:
print(f"{i} is not divisible by {n}")

shadow-wruw
Автор

print("Welocme Mr. Potter")
try:
n = int(input("Enter the number of apples\n"))
mn = int(input("Enter the minimum number to check\n"))
mx = int(input("Enter the maximum number to check\n"))

if mn>mx:
print("Min can't be more than a bigger no than min")

for i in range(mn, mx+1):
if n%i ==0:
print(f"{i} is a divisor of {apples}")
else:
print(f"{i} is not a divisor of {apples}")
except Exception as e:
print("Wrong enter integers only")

nikhilprakash
Автор

n = int(input("Enter the number of Apples given to Harry:"))
min = int(input("Enter the minimum number of students:"))
max = int(input("Enter the maximum number of students:"))

for i in range(min, max+1):
if n % i == 0:
print(i, "is divisior of", n)
else:
print(i, "is not divisor of", n)

shrutisancheti
Автор

# divde the apple in two range min and mx
try :
apple = int(input("enter the number of apple"))
min = int(input("enter the minimum bound"))
max = int(input("enter the maximum bound"))

if min > max:
print("This cannot be range as the min should less than Max")
for i in range(min, max+1):

if apple%i == 0:
print(f"{i} is divisible by {apple}")
else:
print(f"{i} is not divisible by {apple}")
except ValueError:
print("enter interger only")
exit()

Naveen-hjvx
Автор

try:
num = int(input("Enter the number of apples:"))
mn = int(input("Enter the Minimum number of students:"))
mx = int(input("Enter the Maximum number of students:"))

if mn < mx :
for i in range(mn, mx+1):
if(num%i == 0):
print(f"{i} is a divisor of {num}")
else:
print(f"{i} is not a divisor of {num}")

elif(mn > mx):
print("\nThis is not a range!\nMaximum number of students is greater then Minimum number of students.")
elif(mn == mx):
print("\nThis is not a range!\nMaximum number of students is equal to Minimum number of students.")

except Exception as e:
# print(e)
print("Your input is wrong!")

jayeshkaushik
Автор

Thanks Harry bhai for Making Course❤❤👍👍
THIS PROGRAMME IS ENDLESS


while True:
try:
n = int(input("Tell me how many apples you have :) "))
mx = int(input("Maximum number of student :) "))
mn = int(input("Ok, Now tell me the minimum of students :) "))

if mn>=mx:
print("Your entered value of mn and mx is wrong, mn should be less than the mx!!")

for i in range(mn, mx+1):
if n%i==0:
print(f"{i} is a divisor of {n}")
else:
print(f"{i} is not a divisor of {n}")

except ValueError:
print("Please Enter integer value")

n = int(input("Tell me how many apples you have :) "))
mx = int(input("Maximum number of student :) "))
mn = int(input("Ok, Now tell me the minimum of students :) "))

if mn>=mx:
print("Your entered value of mn and mx is wrong, mn should be less than the mx!!")

for i in range(mn, mx+1):
if n%i==0:
print(f"{i} is a divisor of {n}")
else:
print(f"{i} is not a divisor of {n}")

dipaksavaliya