Tips: 1. Follow along as I explain to make sure you understand everything 2. Ideally, work with a friend so you can help each other when you’re stuck 3.

source

26 Comments

  1. Below is an outline of this video.
    0:41: How to use sample files
    1:41: Using comments
    2:21: What’s a function? – Example 1
    4:57: What’s a function? – Example 2
    7:09: A function that takes multiple arguments
    7:58: What’s a function? – 2 more examples
    10:30: Creating a BMI calculator

    Also, a few tips:
    1. Here is the playlist for this series: https://www.youtube.com/watch?v=Z1Yd7upQsXY&list=PLBZBJbE_rGRWeh5mIBhD-hhDwSEDxogDg
    2. Follow along as I explain to make sure you understand everything
    3. Ideally, work with a friend so you can help each other when you’re stuck
    4. If you want to learn faster than I talk, I’d recommend 1.25x or 1.5x speed 🙂
    5. Check the outline in the comment section below if you want to skip around.
    6. Download the sample files here to follow along (they are Jupyter Notebook files): https://www.csdojo.io/python3
    7. To make sure you don’t miss my future tutorial videos, sign up to my newsletter: https://www.csdojo.io/news
    8. Have fun! If anything is unclear, please let me know in a comment.

  2. My Professor thinks he's the real shit in Python by creating videos that are 5 hours long just to explain one concept!!!! Now, this is called a real teaching video!!!! short and informative!!!

  3. i am struggling to take multiple inputs from the user and using it in a function. Help!

    def func_1(x,y):
    return 2*x*y

    x,y = input("enter values separated by comma").split(",")

    print(func_1(x,y))

  4. Ok, I figured out the problem at the end

    km1 = 43

    km2 = 123

    km3 = 230

    def convert_miles(miles):

    km = miles * 1.6

    return km

    result1 = convert_miles(km1)

    result2 = convert_miles(km2)

    result3 = convert_miles(km3)

    print(result1)

    print(result2)

    print(result3)

  5. Quick question: why do we return a function?

    This has been suuchh a help! Great support for my college class:) I do believe the level is a little challenging for someone who hasn't ever been in contact with python/other computer programmings..but maybe its just me. Thaaannk-youu!

  6. name = "YG"

    weight_kg = 90

    height_m = 2

    bmi = weight_kg / (height_m ** 2)

    print(bmi)

    if bmi < 25:

    print(name)

    print("is NOT overweight")

    else:

    print(name)

    print("is overweight")

    name = "YG's sister"

    weight_kg = 70

    height_m = 1.8

    bmi = weight_kg / (height_m ** 2)

    print(bmi)

    if bmi < 25:

    print(name)

    print("is NOT overweight")

    else:

    print(name)

    print("is overweight")

    name = "YG's brother"

    weight_kg = 60

    height_m = 2.5

    bmi = weight_kg / (height_m ** 2)

    print(bmi)

    if bmi < 25:

    print(name)

    print("is NOT overweight")

    else:

    print(name)

    print("is overweight")

  7. I'm a Python beginner, so excuse any silly questions. But would I be correct in saying that variables in the brackets in the function are called parameters, whereas when you call the function, the numbers in the brackets are called arguments?

  8. When you run print(result1), print(result2), and print(result3), why doesn't it print the bmi information along with the return values?

  9. I'm skipping school to learn coding from this guy and i gotta say it's worth it.. this dude is way better than all of my teachers

  10. This is my code:

    # Developer notes:

    # The calculator does not allow the input of 'Str' or 'Float'

    # This function calculates miles into km

    def convert(miles):

    km = 1.6 * miles

    if miles > 1 or miles < 1:

    return str(miles) + ' miles is ' + str(round(km, 2)) + ' km.n'

    else:

    return str(miles) + ' mile is ' + str(round(km, 2)) + ' km.n'

    print('nThe calculator does not accept 'Str' or 'Float'.n')

    # Asks for input and prints the results

    while True:

    km = convert(int(input()))

    print(km)

Leave A Reply

Please enter your comment!
Please enter your name here