How To: Functions in Python 2 (Part 2) - Area Calculator

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • In this video, we are continuing the series of Python 2 and talking about how to use more basic functions in Python2. The project I am working on this time is an Area and Perimeter Calculator which will help us understand the relationship between your main code, and functions in Python. Functions are extremely helpful for you to have blocks of code that you can reuse later! Let me know if you have any questions!
    ** There is an error in the video that froze my computer from 6:30 - 8:00. I'm really sorry about this, so feel free to skip that portion of the video! **
    Here is the base code that I used in the video:
    repl.it/@jfed8...
    Don’t forget to be careful when you are using functions and user input in Python 2 that you keep in mind what the type of variable is. If you are trying to make calculations, change it to a float when you input it! Otherwise it will be input as a string which will make it harder to work with.
    If you want to use a different IDE online, here are some options:
    trinket.io/lib...
    repl.it/langua...
    --------
    In this channel I help developers and small business owners learn about the world of software and technology to bring their businesses to the next level! Using these tips will help you as a programming student, aspiring software engineer, or professional software freelancer! SUBSCRIBE for more content uploaded weekly.
    --------
    My Gear:
    Computer - amzn.to/3hlJG9w
    Camera - amzn.to/2Ypjfat
    Microphone - amzn.to/3fcKVpR

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

  • @idahomeadventures1630
    @idahomeadventures1630 3 ปีที่แล้ว +1

    Thanks. I've been stuck trying to understand this for a while.

  • @liozlink
    @liozlink 3 ปีที่แล้ว +1

    I saw a first video and I said huh was a good one, now, days later I'm subscribing.

    • @modernprogrammer6101
      @modernprogrammer6101  3 ปีที่แล้ว

      So glad you’re enjoying the videos!! :D let me know if there’s anything in particular you would like to see in a future video!

  • @NambaleGerald
    @NambaleGerald 4 ปีที่แล้ว +1

    You are awesome bro 👍

  • @elmerbelandres5018
    @elmerbelandres5018 4 ปีที่แล้ว +1

    Yes! here we go again....amazing, amazing! thank you once again...

  • @tannersmith2570
    @tannersmith2570 4 ปีที่แล้ว +1

    You deserve more subscribers!

  • @EMEFTIES
    @EMEFTIES 3 ปีที่แล้ว +1

    Thanks this is really helpful. Can you be my tutor?

    • @modernprogrammer6101
      @modernprogrammer6101  3 ปีที่แล้ว

      I would love to help however I can! Let me know what questions you have, and I'll try to make a quick video answer to them! Hopefully that helps you, and your colleagues who are also trying to learn!

  • @shady119
    @shady119 4 ปีที่แล้ว +1

    thanks for the help so for the circle it would be radius * 3.56 ?

    • @modernprogrammer6101
      @modernprogrammer6101  4 ปีที่แล้ว +1

      Glad you enjoyed! If you’re doing radius it would be Pi * radius ^ 2 (you can use the math library for the squared, or just say radius * radius) if you want perimeter, you do Pi * radius * 2!

    • @shady119
      @shady119 4 ปีที่แล้ว +1

      @@modernprogrammer6101 says that "pi" is not defined

    • @shady119
      @shady119 4 ปีที่แล้ว +1

      So I used math.pi

    • @modernprogrammer6101
      @modernprogrammer6101  4 ปีที่แล้ว

      Exactly! You can either do that or use an approximation of Pi, as 3.14