How to Draw Fractal or Recursion tree using python

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии •

  • @Captivator_X
    @Captivator_X Год назад

    i'm a student studying in 11th,and this tree kept my attention for last 1-2 years but I wasn't able to find the code for this finally u helped me and also explained the code to me. Thank you sir❤

  • @davidessang1696
    @davidessang1696 4 года назад +1

    I toggled with the '3' and '4' of the equation 3*i/4. From what I observed, the '3' affects how the density and number of the branches that are created. While the '4' affects how far each branch extends.

  • @daringd2147
    @daringd2147 Год назад

    If we are just creating a loop then we can just create while or more ideal a For loop to complete this Mechanism . Why are we creating def function for completing the project as a For loop would be more efficient in this situation .

  • @davidessang1696
    @davidessang1696 4 года назад +2

    Thank you for taking the time to explain the code step by step. After all, there is no use in using code when you don't understand how it works. I also appreciate your taking to explain each written line of code and its elements.

  • @juefeicheng
    @juefeicheng 3 года назад

    Thank you - this is very helpful to model!

  • @robintong7349
    @robintong7349 3 года назад

    Thank you! You are the youtuber who tutor this most explicitly.

  • @nataliamendera2661
    @nataliamendera2661 4 года назад

    Thank you, great tutorial!

  • @vaishalirawal9140
    @vaishalirawal9140 4 года назад +1

    Bro how do I make my tree a little bold ..... Thank you for the tutorial

  • @classclef
    @classclef Год назад

    i am missing something. how does "i" increase going backwards? ending with 100?

  • @umcasalcompastoralemao
    @umcasalcompastoralemao 5 лет назад

    Hello! friend i am very grateful for your work and would like you to give me more ways to improve my knowledge in Python with Manuals and Projects or even another very intensive content

  • @whitebird365
    @whitebird365 4 года назад

    bro I've tried working on three branches tree.. How can I message you the code to take a look on it?

    • @Iknowpython
      @Iknowpython  4 года назад

      Mail me at iknowpython14@gmail.com

  • @tarunkumargola7633
    @tarunkumargola7633 4 года назад +5

    tree code for 3 branch:
    import turtle
    hr = turtle.Turtle()
    hr.left(90)
    hr.speed(150)
    def tree(i):
    if(i>=20):
    hr.forward(i)
    hr.left(30)
    tree(3*i/4)
    hr.right(30)
    tree(3*i/4)
    hr.right(30)
    tree(3*i/4)
    hr.left(30)
    hr.backward(i)
    tree(100)
    turtle.done()

  • @OldePup
    @OldePup 4 года назад

    Keep up the great work, you explain things very well.

  • @ashishsingh7056
    @ashishsingh7056 5 лет назад

    #bhai #awesome #zehar #tabhai #1 number

  • @TECHNICALGOLU
    @TECHNICALGOLU 5 лет назад

    which program do you use for python

  • @bharathkumargadi352
    @bharathkumargadi352 3 года назад

    Bro Complete Python Course Pettandi broo plzzz

  • @pdgamer7088
    @pdgamer7088 3 года назад

    I don't understand 6 line how to type def tree(I):

  • @mianmohammadrassel9504
    @mianmohammadrassel9504 4 года назад

    bro i have solve the problem making the tree with three branches, i have already send the code to your mail

  • @ashishsingh7056
    @ashishsingh7056 4 года назад +1

    bro please make a vedio on paint application in python

  • @reynac8016
    @reynac8016 4 года назад

    why i am getting an error "'break' outside loop"

    • @Iknowpython
      @Iknowpython  4 года назад

      So keep the break inside mannn male sure you are indenting the break properly 😊

    • @LenHarms
      @LenHarms 4 года назад

      I'm getting the same thing, have you figured it out? I'm absolutely sure my code ws indented correctly. Break statements are made to break out of a loop and there is no loop here. I replaced the function with this code
      def tree(branchLength, angle):
      """Make a tree"""

      while branchLength > 10:
      turt.forward(branchLength)
      turt.left(angle)
      tree(branchLength * 0.75, angle)
      turt.right(angle * 2)
      tree(branchLength * 0.75, angle)
      turt.left(angle)
      turt.back(branchLength)
      return

  • @shaminmohammed672
    @shaminmohammed672 5 лет назад

    Cool

  • @ashishsingh7056
    @ashishsingh7056 4 года назад +1

    apki vedio nahi aa rahi hai brother

  • @LenHarms
    @LenHarms 4 года назад

    Turtle.speed() goes from 0-10 setting it higher makes no difference.

  • @vinothnofear93
    @vinothnofear93 4 года назад

    Stop giving advise bro