Solve 10 loops problem in python

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 483

  • @computerscience68
    @computerscience68 9 หลายเดือนก่อน +62

    Sum of even :-
    even_sum=0
    N=10
    for i in range(1,N+1):
    If (i%2==0):
    even_sum+=i
    print(even_sum)

  • @subhadeepbanerjee7361
    @subhadeepbanerjee7361 4 หลายเดือนก่อน +9

    q2 soln::
    n = int(input("Enter a number: "))
    sum=0
    for num in range(0,n+1):
    if(num%2==0):
    sum+=num
    print("Sum of even numbers from 0 to",n,"is",sum)

  • @neamulkabiremon
    @neamulkabiremon 9 หลายเดือนก่อน +10

    Wow! This is exactly what I was looking for. 10 loop problems in one video, perfect for practicing and mastering loop concepts in Python. Thanks for the clear explanations and concise solutions!

  • @afzalhamdulay
    @afzalhamdulay 9 หลายเดือนก่อน +4

    thankyou for this video. related to 10th question, i extender the code where we ask the user to input string and check it. the wait time increases if inputs wrong string. and in max 5th try, the code gives "blocked" statement. code below:
    import time
    wait_time = 1
    max_tries = 5
    attempts = 1
    password = "password"
    while True:
    user_input = input("Enter password: ")
    if attempts < max_tries:
    if user_input == password:
    print("logged in succesfully")
    break
    else:
    print("wrong password")

    print("Attempt: ", attempts, " | wait time: ", wait_time,"seconds | max attempts: ", max_tries)
    time.sleep(wait_time)
    wait_time *= 2
    attempts += 1
    else:
    print("Your are blocked. please contact branch manager")

  • @hishwh9454
    @hishwh9454 8 หลายเดือนก่อน +1

    Wow! This is exactly what I was looking for 10 loop problems in one video, perfect for practicing and mastering loop concepts in Python. Thanks for the clear explanations and concise solutions.

  • @virajkabbur765
    @virajkabbur765 4 วันที่ผ่านมา

    No one cares to make their students practice actual problems. Thank you sir for such a wonderful hands-on series.

  • @parneetsingh3143
    @parneetsingh3143 2 หลายเดือนก่อน +2

    I am really thankful we have TH-cam , otherwise this masterpiece may have been lost

  • @tech_taugh
    @tech_taugh 9 หลายเดือนก่อน +4

    Hitesh sir tons of love from Nepal you are just amazing , the effort, the content and ofCourse the quality education no one can match your level

  • @aakashSharma-is9bk
    @aakashSharma-is9bk 9 หลายเดือนก่อน

    sir because of this course i have learnt many things...thank you for bringing this course for free ...... middle class families are successfull because of you

  • @sinesta2406
    @sinesta2406 2 หลายเดือนก่อน

    Guys he is trying his best to teach us all the topics in a very different so we can learn all the complex and advance topics in a very easy manner, and in return all he asks just some comments, and we are not completing the goal. That's not fair, we should keep motivating him for his efforts.

  • @kartikpaul3161
    @kartikpaul3161 2 หลายเดือนก่อน +2

    number = 10
    sum = 0
    for i in range(1,number+1):
    if i % 2 == 0:
    sum += i
    print(sum)
    Ans is : 30

    • @pakcricket619
      @pakcricket619 หลายเดือนก่อน

      bro sum is a method ap variable ka name change kro

  • @pranaypaul6361
    @pranaypaul6361 9 หลายเดือนก่อน +1

    find tuned approach to hammer the basic of any given chapter through this 10 problem solving mechanism...thank you sir.

  • @VinaySheoran007
    @VinaySheoran007 6 หลายเดือนก่อน +4

    40:15 09_solution ko karna ka dusra tarika
    items = ["apple", "banana", "orange", "apple", "mango"]
    for i in items:
    if items.count(i) >1:
    print(i, "is a duplicate item in list.")
    break

    • @forstudyfacts
      @forstudyfacts 2 หลายเดือนก่อน

      Ha bhai same Maine bhi aise hi Kiya tha 😅😅 and it worked

  • @DhruvGupta-n2c
    @DhruvGupta-n2c 9 หลายเดือนก่อน +7

    sir i think in 2nd problem the question would be count the even no. upto n (sum means 2+4+6+8+10)

    • @shivam_shahi
      @shivam_shahi 6 หลายเดือนก่อน

      n = 10
      even = 0
      for i in range(1,n+1):
      if i % 2 == 0:
      even += i

      print(even)

    • @SamraatMaharjan
      @SamraatMaharjan 5 หลายเดือนก่อน +1

      that's why I thought. It should have been (sum means 2+4+6+8+10). Maybe he meant counting total number of even numbers up to 10.

    • @alimohdbilalraza
      @alimohdbilalraza 4 หลายเดือนก่อน

      @@SamraatMaharjan yes, i also came for this. it is mentioned sum of even numbers not count of even numbers

    • @alimohdbilalraza
      @alimohdbilalraza 4 หลายเดือนก่อน

      numbers = range(11)
      sum = 0
      for nums in numbers:
      if nums % 2 == 0:
      sum += nums
      print(sum)

  • @winter_1306
    @winter_1306 9 หลายเดือนก่อน +2

    i can't even fathom how simple it has become to understand the concepts with this course (and interesting too, hehe)

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def factorial(a):
    mul=1
    i=1
    while i

  • @gautamraj8114
    @gautamraj8114 9 หลายเดือนก่อน +1

    list uniqueness and exponential backoff - 2 very unique problems.. Great clarity on loops

    • @rwordspecialist6734
      @rwordspecialist6734 9 หลายเดือนก่อน

      Bro is there a issue in the list uniqeness code bcz im having type eroor of list obj isnt callable

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def sums(a):
    sum_ =0
    i =0
    while i

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    3 -- >
    num = 5
    for i in range(1,11):
    if i == 5:
    continue
    print(f"{num} x {i} = ",num * i)

  • @yashchhatrala9207
    @yashchhatrala9207 4 หลายเดือนก่อน

    Problem 2:
    n = int(input("Enter the nth number: "))
    sum_even = 0
    for i in range(1, n+1):
    if i%n == 0:
    sum_even = i + n
    print(sum_even)

  • @yashchhatrala9207
    @yashchhatrala9207 4 หลายเดือนก่อน

    Problem 3:
    table = int(input("Enter the table: "))
    table_print = 1
    for i in range(1, 10+1):
    if i == 5:
    continue
    table_print = table * i
    print(table, "*" ,i, "=", table_print)

  • @FizaFakher
    @FizaFakher หลายเดือนก่อน

    sir ma comment nhe krte zada but sach ma apke content oop ha mujhe khe bhe smj nhe ayethe js apne smja de or ab python ma loops sir seriously hats off

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def revers_string(a):
    reverse =""
    i =len(a)-1
    while i>=0:
    reverse+=a[i]
    i-=1
    print(reverse)
    a =input("enter the string:")
    revers_string(a)
    ans--4

  • @ompandya30
    @ompandya30 5 หลายเดือนก่อน

    number = int(input("enter one number:-"))
    factorial = 1
    for i in range(1, number + 1):
    factorial *= i
    print("factorial of given number is", factorial)

  • @englishforme4859
    @englishforme4859 2 หลายเดือนก่อน +1

    for i in range(1,N+1):
    If (i%2==0):
    even_sum+=i

  • @varunverma1534
    @varunverma1534 4 หลายเดือนก่อน

    33:06
    a=(int(input('enter a:'))
    While 0>a or a

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    Q4. Reverse string using Loop
    a = "Gulab Alam"
    b = len(a)-1
    while b >= 0:
    print(a[b])
    b-=1
    Using FOR Loop
    x = "Tarun"
    y = " "
    for i in x:
    y = i + y
    print(y)

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def keep_ask(a):
    a =int(a)
    while a>10:
    a =int(input("enter the number again:" ))
    if 1

  • @Ritu-u8g
    @Ritu-u8g วันที่ผ่านมา

    Generally while loop seems difficult to me, here is the answer to those who are trying using while loop:☺
    Problem 1:
    # while
    list = [8, 5, -5 , -9, -7]
    n = 0
    ij = 0
    while n < len(list):
    if list[n] > 0:
    ij +=1
    n +=1
    print(ij)
    Problem 2 :
    # using while
    n = 0
    s = 0
    while n

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def mul_n(a):
    i=1
    while i

  • @yashpatil9622
    @yashpatil9622 5 หลายเดือนก่อน

    n = 10
    sum_even = 0
    for y in range(1,n+1):
    if y%2 == 0:
    sum_even = y + sum_even
    print(sum_even)
    This is the correct code for the problem no 2

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    numb = 5
    factorial = 1
    # while numb > 0:
    # factorial = factorial * numb
    # numb = numb -1
    # print(factorial)
    for i in range(numb):
    factorial = factorial * (i+1)
    print(factorial)

  • @anandshinde0358
    @anandshinde0358 8 หลายเดือนก่อน +1

    29:43 sir try kiya
    fruit_color="Yellow"
    if fruit_color=="Green":
    status="Unripe"
    elif fruit_color=="Yellow":
    status="Ripe"
    elif fruit_color=="Brown":
    status="Overripe"
    print("fruit are",status)

  • @sandeepkarukayil
    @sandeepkarukayil 2 หลายเดือนก่อน

    number = 3
    for i in range(1,11):
    if(i==5):
    continue

    print(number*i)

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    Multiplication Table Printer (upto 10, but skip 5th iteration)
    Using For Loop
    n = int(input("Enter the number: "))
    for i in range (1,11):
    if i == 5:
    continue
    print(n,"*",i,"=",n*i)
    Using While Loop
    i = 1
    num = 7
    while i

  • @hitarthmunjal2046
    @hitarthmunjal2046 9 หลายเดือนก่อน

    num = int(input("Enter the number :"))
    sum = 0
    for i in range(1, num + 1):
    if i % 2 == 0:
    print(i)
    sum = sum + i

    print("sum is ", sum)

  • @rneditz3250
    @rneditz3250 5 หลายเดือนก่อน +3

    Vote For JAVA Series also Guys. We want someone Bigger Than Abdul Bari Sir and i think Hitesh Sir can only do that.

  • @ompandya30
    @ompandya30 5 หลายเดือนก่อน

    Solution 2:-
    n = int(input("Enter a number: "))
    sum_even = 0
    for i in range(0, n, 2):
    sum_even += i
    print("The sum of all even numbers up to", n, "is", sum_even)

  • @Double_O_ff
    @Double_O_ff 9 หลายเดือนก่อน

    Abdul Wahid
    from Bangladesh
    ------------------------------------05
    number = 5
    factorial = 1
    while number > 0:
    factorial = factorial * number
    number = number - 1
    print("factorial number value is : ", factorial)

  • @sandeepkarukayil
    @sandeepkarukayil 2 หลายเดือนก่อน

    n= 10
    sum = 0
    for num in range(1,n+1):
    if(num%2==0):
    sum+=num

    print(sum)

  • @yashrahadve
    @yashrahadve 7 หลายเดือนก่อน

    This teaching technique is best for understanding please implement this technique in other courses, please
    It's my humble request to Hitesh Sir Jii

  • @manastahir
    @manastahir หลายเดือนก่อน

    while True:
    user_input = int(input("Enter a number b/w 1 to 10: "))
    # if user_input >= 1 and user_input

  • @NOR-gate
    @NOR-gate 5 หลายเดือนก่อน

    [Sir ,a little Correction Q_2]
    # number = int(input("Enter the number till you want to get sum :"))
    sum = 0
    number = 10
    for i in range(number):
    # if i % 2 == 0:
    sum = sum+i
    print(sum)

  • @sandeepkarukayil
    @sandeepkarukayil 2 หลายเดือนก่อน

    numbers = [1,-2,3,-4,5,6,-7,-8,9,10]
    for num in numbers:
    if(num>=0):
    print(num)

  • @jd26831475
    @jd26831475 9 หลายเดือนก่อน

    number = 15
    sum = 0
    for num in range(0, number+1):
    if num % 2 == 0:
    sum = sum + num
    print("Total sum is ", sum)

  • @risingaw1163
    @risingaw1163 7 หลายเดือนก่อน

    # Sum of even numbers
    n = 5
    sum_even = 0
    for i in range(1,n+1):
    if i%2 == 0:
    sum_even += i
    print("Sum of even number is:" ,sum_even)

  • @ompandya30
    @ompandya30 5 หลายเดือนก่อน

    numbers=[1,-2,3,-4,5,6,-7,-8,9,10]
    n=len(numbers)
    count=0
    for i in range(n):
    if numbers[i]>0:
    count=count+1
    print(count)

  • @SurajKumar-mc9eg
    @SurajKumar-mc9eg 9 หลายเดือนก่อน

    def find_Factorial(n):
    sum = 1
    for i in range(1,n+1):
    sum *= i
    print (sum)
    n = int(input("enter no: "))
    find_Factorial(n)

  • @kishandata23
    @kishandata23 9 หลายเดือนก่อน

    i have 2 years of experience in Python but still watch your video to get the internal working of each topic.🫡
    After watching your video i have started to assign the value by giving space.
    before=2
    after = 2
    😅😅

  • @Piyush-xv1bb
    @Piyush-xv1bb 9 หลายเดือนก่อน +1

    Sir love the way you explain the complex concepts easily in a simple way Hats off to you❤❤

  • @prithvisalve9114
    @prithvisalve9114 2 หลายเดือนก่อน

    Even Number Question Solution .
    starting_range = int(input("Enter the number here: "))
    ending_range = int(input("Enter the number here: "))
    sum_even_num = 0
    for num in range(starting_range,ending_range):
    if num%2==0:
    sum_even_num = sum_even_num + num
    print(sum_even_num)

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    Count Positive Number
    Using While Loop
    num = [1, -2, 3, -4, 5, 6, -7, -8, 9, 10]
    i = 0
    postive_num = 0
    while i < len(num):
    if num[i] > 0:
    postive_num+=1
    i+=1
    print("Final Count:",postive_num)
    Using For Loop
    num = [1, -2, 3, -4, 5, 6, -7, -8, 9, 10]
    postive_num1 = 0
    for i in num:
    if i > 0:
    postive_num1+=1
    print("Count of Positive Number:", postive_num1)
    Using List Comprehensive
    p= [i for i in num if i > 0]
    print("Positive Number in List:",len(p))

  • @Double_O_ff
    @Double_O_ff 9 หลายเดือนก่อน

    number = 5
    factorial = 1
    while number > 0:
    factorial *= number
    number = number - 1
    print("factorial number value is : ", factorial)

  • @ثابت-89
    @ثابت-89 3 หลายเดือนก่อน +1

    #Validate Input
    on = True
    while on:
    ask = input("Plese type a number (1-10) : ")
    try:
    if int(ask) >= 1 and int(ask)

  • @shashankpandey8346
    @shashankpandey8346 9 หลายเดือนก่อน

    For those who want to protect original number in factorial problem, create another value x then.
    x = number and then start loop and decrease x. Since x = x-1 will assign a new value to x, the value of number remains unaffected.
    But if you are still doubtful, just do x = int(number). This is initially create 2 values in memory.

  • @Godxxillaa
    @Godxxillaa 6 หลายเดือนก่อน

    a = 2
    for i in range(1, 11):
    if i == 5:
    continue
    else:
    print(a * i)

  • @ShubhamRaj-z8e
    @ShubhamRaj-z8e 5 หลายเดือนก่อน

    Solution 2:
    n = 10
    sum_even = 0
    for i in range(1, n+1):
    if(i%2==0):
    sum_even = sum_even + i
    print(sum_even)

  • @AmitKumar-mw4jn
    @AmitKumar-mw4jn 4 หลายเดือนก่อน

    Question: 7-
    while True:
    number=int(input("please enter the number between 1 and 10 :"))
    if 1

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    distance = int(input("Enter Distace of your location : "))
    if distance 3 and distance 15:
    mode = "Car"

    print(mode)

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    #Factorial Using While Loop
    n = int(input("Enter Number which to be factorial: ")) i=1
    while_fact = 1
    while i

  • @afzalhamdulay
    @afzalhamdulay 9 หลายเดือนก่อน

    one more way to create the third solution:
    num = int(input("enter you table number: "))
    for i in range(1,11):
    if i != 5:
    print(num, "X", i, "=", num*i )

  • @subhadeepbanerjee7361
    @subhadeepbanerjee7361 4 หลายเดือนก่อน +1

    # Problem: Print the multiplication table for a given number up to 10, but skip the fifth iteration.
    n = int(input("Enter a number: "))
    for i in range(1,11):
    if(i==5):
    continue
    print("{} * {} = {}".format(n,i,(n*i)))

  • @FuqanAzeem-r2t
    @FuqanAzeem-r2t 4 หลายเดือนก่อน

    #string reverse using while loop
    university_name = 'Riphah International University'
    string_length = len(university_name)-1
    while(string_length>=0):
    print(university_name[string_length] , end=' ')
    string_length = string_length-1

  • @anupammishra2974
    @anupammishra2974 7 หลายเดือนก่อน

    # Calculate the sum of even numbers up to give number n
    n = 10
    sum = 0
    for i in range(2,n+1,2):
    sum += i
    print(sum)

  • @kolkatarockerz
    @kolkatarockerz หลายเดือนก่อน

    Solution of the 2nd Problem:
    num=int(input("Enter the number here"))
    sum_even_num=0
    for i in range(num+1):
    if i%2==0:
    sum_even_num=sum_even_num+i
    print("Sum of even nos. is", sum_even_num)

  • @siddhant2943
    @siddhant2943 8 หลายเดือนก่อน

    It is very disheartening to see that very few people are following this amazing playlist. The habit of consuming content has made our mindset so fragile that we could scroll shorts for infinity but we can't sit back straight for an hour to solve basic problems. And then people will whine about AI taking over us on the internet. If we do not change this way of living then maybe the AI doom is inevitable. But if we start learning and developing a problem-solving mindset rather than watching endless tutorials then we could really grow professionally and personally. This playlist, and almost every other playlist made by Hitesh sir really beats any paid tutorials since this series develops a problem-solving mindset rather than making people syntax ninja.

  • @saatwik_saatwik
    @saatwik_saatwik 5 หลายเดือนก่อน

    For Problem 2, Question is asking to sum all even numbers, Not just count. The correct solution is anyone is wondering is : -
    def sum_checker(n):
    even_list = []
    for i in range(1,n+1):
    if i%2 == 0:
    even_list.append(i)
    final_sum = sum(even_list)
    return final_sum

    • @chaiaurcode
      @chaiaurcode  5 หลายเดือนก่อน

      Nope. Aapne question hamesha isi trh dekha h, isliye yahi sahi solution lagta h.
      Kuch different h ye

    • @NOR-gate
      @NOR-gate 5 หลายเดือนก่อน

      @@chaiaurcode Sir, you did Counting of even Number i guess ?

  • @yashchhatrala9207
    @yashchhatrala9207 4 หลายเดือนก่อน

    Problem 1:
    numbers = [1, -2, 3, -4, 5, 6, -7, -8, 9, 10]
    positive_number_count = 0
    for num in numbers:
    num = int(num)
    if num > 0:
    positive_number_count += 1
    print("Final count positive number is:",positive_number_count)

  • @TheMeme-etry
    @TheMeme-etry 8 หลายเดือนก่อน

    # Problem: Calculate the sum of even numbers up to a given number n.
    number : int = int(input("Enter a number up to which you want to calclate sum of even numbers"))
    sum_of_even_numbers:int = 0
    for i in range(1,number+1):
    if i%2 == 0:
    sum_of_even_numbers = sum_of_even_numbers+ i
    print(sum_of_even_numbers)

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    2 -->
    num = 10
    sun_even = 0
    initial_num = 0
    for i in range(10):
    initial_num +=1
    if initial_num % 2 == 0:
    sun_even += 1
    print(initial_num)
    num +=initial_num
    print("the total is :", num)
    print("the total is :", sun_even)

  • @zalaam_0
    @zalaam_0 9 หลายเดือนก่อน

    I think "f" string is more good then that like we do in javascript
    ```
    number = 3
    for i in range(1, 11):
    if i == 5:
    print(""" "5" is Detected""")
    continue
    print(f"{number} x {i}= {number * i}")
    ```

  • @anandshinde0358
    @anandshinde0358 8 หลายเดือนก่อน +1

    10:16 sir sum_even +=I ayega sum of even number ke liye

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    string = "python"
    rev = ""
    for i in string:
    rev = i + rev
    print(rev)
    #aonther method
    print(string[::-1])

  • @JagjeetSinghDA
    @JagjeetSinghDA 7 หลายเดือนก่อน +2

    Hi Hitesh sir, I was watching your loops video and I found that in 2nd loop problem, by mistake you have add sum_even += 1, which is wrong, sum of even numbers till 10 can not be 5, so guys please check this, although Hitesh sir have already told to verify the solution. I have read the comments and found that not even 1% people wrote about this, I don't know what are doing, just watching videos on their bed laying down.

    • @SamiButt-bc2xh
      @SamiButt-bc2xh 5 หลายเดือนก่อน

      To find the number of even numbers from 1 to 10, we can simply list them and count them. The even numbers between 1 and 10 are:
      2
      ,
      4
      ,
      6
      ,
      8
      ,
      10
      2,4,6,8,10

  • @itsdipanshu0069
    @itsdipanshu0069 2 หลายเดือนก่อน

    num=int(input("Enter the number:
    "))
    sum_even=0
    for i in range(1,num+1):
    if i%2==0:

    sum_even=sum_even + i
    print("sum of even number is: ",sum_even)
    solution of problem 2

  • @ansaralex580
    @ansaralex580 8 หลายเดือนก่อน

    For those who didn't understand the " reverse string code " :
    input_string = "Python"
    reverse_string = ""
    for char in input_string :
    # reverse_string = reverse_string + char
    reverse_string = char + reverse_string
    print(reverse_string)
    Explaination:- Iteration 1 (char = 'P'):
    At the beginning, reverse_string is an empty string.
    After the first iteration, reverse_string becomes 'P'.
    Iteration 2 (char = 'y'):
    reverse_string is currently 'P'.
    Concatenating 'y' with 'P', so reverse_string becomes 'yP'.
    Iteration 3 (char = 't'):
    reverse_string is currently 'yP'.
    Concatenating 't' with 'yP', so reverse_string becomes 'tyP'.
    Iteration 4 (char = 'h'):
    reverse_string is currently 'tyP'.
    Concatenating 'h' with 'tyP', so reverse_string becomes 'htyP'.
    Iteration 5 (char = 'o'):
    reverse_string is currently 'htyP'.
    Concatenating 'o' with 'htyP', so reverse_string becomes 'ohtyP'.
    Iteration 6 (char = 'n'):
    reverse_string is currently 'ohtyP'.
    Concatenating 'n' with 'ohtyP', so reverse_string becomes 'nohtyP'.
    After the loop completes, reverse_string contains the reversed version of the input string 'Python', which is 'nohtyP'.

  • @ashishshinde7127
    @ashishshinde7127 8 หลายเดือนก่อน

    I added few things in 8th solution:
    number = int(input("Enter a number to check if its prime or not:
    "));
    ans = None
    if number>1:
    for i in range(2,number):
    if (number%i)==0:
    ans = False
    break
    else:
    ans = True
    if ans!=None:
    print(ans)
    else:
    print('Enter valid number! ')

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    import random
    Weather = ["Sunny", "Snowy","Rainy"]
    all_weather = random.choice(Weather)
    if all_weather == "Sunny":
    print("Go for a walk")
    elif all_weather == "Rainy":
    print("Read a Book")
    elif all_weather == "Snowy":
    print("Build a snow man")

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def positive_count(a):
    count =0
    negetive_count=0
    for i in a:
    if i>=0:
    count+=1
    else:
    negetive_count+=1
    print("total positive count is :",count)
    print("total -ve count is:",count)
    a =[1,-2,3,4,-5,6,-7,8,-9,10]
    positive_count(a)

  • @pranaypaul6361
    @pranaypaul6361 9 หลายเดือนก่อน

    for #2 problem --> sum_even += i #30
    for #4 problem another way could be --> for char in name:
    rev_string = rev_string.join(char) + rev_string

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 3 หลายเดือนก่อน

    def duplicate_checker(a):
    b =set()
    for l in a:
    if a.count(l)>1:
    b.add(l)
    print(b)

    a=["apple","banana","chai","orange","apple","papaya", "banana","chai"]
    duplicate_checker(a)
    ans--9

  • @sheshadrivijay8014
    @sheshadrivijay8014 4 หลายเดือนก่อน

    Been truly amazing classes Getting valuable things for free.
    Good initiative !!

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    Q2. Sum of Even Number
    Using For Loop(way-1)
    n = int(input("Enter the value of n:"))
    sum_1= 0
    for i in range (0,n+1,2):
    sum_1+=i
    print("Sum of Even Number:", sum_1)
    Using For Loop(way-2)
    num = int(input("Enter the value of num:"))
    sum_positive_num=0
    for i in range(0,num+1):
    if i%2==0:
    sum_positive_num+=i
    print("Sum of Even Num:", sum_positive_num)
    Using While Loop
    number = int(input("Enter Number:"))
    count_of_even = 0
    i=0
    while i < number+1:
    if i%2==0:
    count_of_even+=i
    i+=1
    print("Sum of even number:",count_of_even)

  • @Nazmul.Hassan
    @Nazmul.Hassan 20 วันที่ผ่านมา

    Thank you Hitesh Bhai for the Great Course and Teaching Style

  • @Godxxillaa
    @Godxxillaa 6 หลายเดือนก่อน

    # Reverse a String
    # Problem: Reverse a string using a loop.
    sting_given = "musab"
    answer = ""
    for ch in range(1, len(sting_given) + 1):
    answer = answer + sting_given[-ch]
    print(answer)

  • @kaustubhkadam1083
    @kaustubhkadam1083 4 หลายเดือนก่อน

    Problem 2 without loops
    number_input = int(input("Enter your number: "))
    number_even = number_input if number_input%2 == 0 else number_input-1
    no_of_terms = number_even/2
    sum_of_even_numbers = no_of_terms*(no_of_terms + 1)
    print(sum_of_even_numbers)

  • @OmPrakash-268
    @OmPrakash-268 8 หลายเดือนก่อน

    02_solution.py [ correct code ]
    Sum of even :-
    n=10
    even_sum=0
    for i in range(1,n+1):
    If (i%2==0):
    even_sum+=i
    print(even_sum)

  • @sandeepverma8681
    @sandeepverma8681 9 หลายเดือนก่อน

    00:02 Python loops have different internal workings and are iterable
    02:32 Count the positive numbers in a list using a loop.
    06:28 Solving problems using loops in Python
    08:29 Loop to calculate the sum of even numbers
    13:00 Using 'continue' to skip iterations in a loop
    15:18 Learned reverse string using a loop.
    19:22 Finding the first non-repeated character in a string using loops in Python
    21:13 Optimizing Python code using break statement
    25:02 Understanding factorial and implementing it using while loop
    26:40 Finding factorial in Python using loops
    30:48 Using while loops with user input and conditional checks in Python
    32:39 Understanding the concept of prime numbers in Python.
    36:46 Check for divisibility and prime numbers in Python
    38:37 Check for zero remainder after division to determine if a number is prime.
    42:41 Adding unique items to a set and detecting duplicates in a loop
    44:31 Import time for managing wait time and attempts
    48:05 Understanding the concept of wait time in loops
    Crafted by Merlin AI.

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    num = int(input("enter number from 1 to 10 :"))
    while num 10:
    print("Invalid input, please enter a number between 1 and 10")
    num = int(input("enter number from 1 to 10 :"))
    # if num 10:
    # print("Invalid input, please enter a number between 1 and 10")
    # num = int(input("enter number from 1 to 10 :"))

  • @gulabalam2275
    @gulabalam2275 3 หลายเดือนก่อน

    #Prime Number Checker
    n = int(input("Enter the number to check either it is prime or not: "))
    if n > 1:
    for i in range (2, n):
    if (n % i) == 0:
    print(f"{n} is not a prime number")
    break
    else:
    print(f"{n} is the Prime Number")

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    1 -- >
    numbers = [1,-2, 3,-4,5,6,-7,-8,9,10]
    positive_count = 0
    for i in numbers:
    if i > 0:
    positive_count = positive_count +1
    if i % 2 !=0:
    print(f"{i}, is a odd number", end=" ")
    print(f"
    Positive numbers in the list are {positive_count}")

  • @anandshinde0358
    @anandshinde0358 8 หลายเดือนก่อน +2

    17:53 string is immutable

  • @YogeshKumar-hk5sc
    @YogeshKumar-hk5sc 4 หลายเดือนก่อน

    Sir you count the even number
    But hm ko nikalna tha sum of even number so
    Sum_even+=I
    Print (sum_even)

  • @Airman.programer
    @Airman.programer 3 หลายเดือนก่อน

    input_str = "teeteravs"
    for i in input_str:

    if input_str.count(i) ==1:
    print(i)
    break

  • @ig_atlantis
    @ig_atlantis 9 หลายเดือนก่อน

    10:10 Sir in the question it is given to print the sum of even numbers. But you have calculated the total number of even numbers in range(1, n+1). Correct code should be:
    n = 10
    sum = 0
    for number in range(1, n+1):
    if number%2 == 0:
    sum += number
    print("Sum of even numbers: ",sum)

  • @sheikhabdullah8298
    @sheikhabdullah8298 9 หลายเดือนก่อน

    Great Examples, Simplest Explanations, Thank You

  • @Chirag12390
    @Chirag12390 9 หลายเดือนก่อน

    Sir aap dheere dheere aage bdte ho baki you tubers ek dum se 😂😂😂😂😂😂aap bdiya ho 😊😊

  • @lazithegamer
    @lazithegamer 2 หลายเดือนก่อน

    In question 2, instead of using += 1, we have to use += number, so the answer will the the addition of the even numbers.

  • @Dheerajsingh-n8k
    @Dheerajsingh-n8k 9 หลายเดือนก่อน

    The video covers solving 10 loops problems in Python, including understanding factorial, prime numbers, and input validation. It emphasizes the importance of wait times for system response and user experience, as well as the use of conditional checks for verifying uniqueness and avoiding duplicates in loops.
    00:00
    Understanding Loops and Iteration in Python
    05:53
    Understanding Loops and Iterations in Programming
    11:48
    Learning Python Programming: Looping and Reversing Strings
    11:48Understanding the process of printing a table and complicated math for loops.
    13:05Learning about conditional checks, detecting the fifth iteration, and using the 'continue' keyword.
    15:26Exploring reverse string using loops and understanding the process of character swapping.
    17:45
    Optimizing String Manipulation and Looping in Python
    23:41
    Understanding Factorial Calculation Using While Loop in Python
    29:34
    Understanding Prime Numbers and Validating Solutions
    35:28
    Understanding Prime Numbers and Unique Items in Python
    41:23
    Understanding Unique Items and Conditional Checks
    47:16
    Understanding Sleep Time and System Response in Python Programming

  • @babul3937
    @babul3937 4 หลายเดือนก่อน

    10:17 : ac my understanding . sum of even number do not mean number of even number??? and formula for sum of consecutive even numver upto nth number is n^2 or sum+=i