Ben's Computer Science Videos
Ben's Computer Science Videos
  • 14
  • 45 868
Python 3 Debugging TypeError: Unsupported Operand Types
This video explores the errors that Python reports when one attempts to apply an operator to values with illegal types for that operator. Watching this video will help you better understand and debug the Python error messages TypeError: unsupported operand types, TypeError: can’t multiply sequence by non-int and TypeError: can only concatenate str to str.
zhlédnutí: 796

Video

Python 3 Debugging IndexError: list index out of range
zhlédnutí 97Před 2 lety
This video examines the possible causes for a Python list index out of range error and demonstrates how to identify the source of the error and correct it.
Python 3 Debugging SyntaxError: invalid syntax
zhlédnutí 1,5KPřed 2 lety
Causes of the Python 3 error message SyntaxError: invalid syntax are examined, along with how to correct the error in each case. 0:00 Introduction 0:12 Cause #1: Missing Comma 0:45 Cause #2: Unbalanced Parentheses 1:24 Cause #3: String Delimiter inside a String 2:08 Cause #4: Assignment to a Reserved Word 2:32 Cause #5: Using = instead of 3:11 Cause #6: Malformed Relational Operators 3:42 Cause...
Python 3 Programming Tutorial: StatesOfMatter.py
zhlédnutí 587Před 6 lety
A Python program that demonstrates if statements, if-else statements and if-elif-else statements by reporting the state of matter for gold at a temperature entered by the user.
Python 3 Programming Tutorial: LetterToGradePoints.py
zhlédnutí 6KPřed 6 lety
A Python program that demonstrates an if-elif-else statement and an if-else statement by converting a letter grade to the equivalent number of grade points.
Python 3 Programming Tutorial: Mode.py
zhlédnutí 505Před 6 lety
A Python program that demonstrates list and dictionary data structures by reading a list of values from the user, storing them in a list, and computing the mode of the list of values.
Python 3 Programming Tutorial: Tax.py
zhlédnutí 10KPřed 6 lety
A Python program that demonstrates an if-elif-else statement by computing and reporting the Canadian federal income tax payable for an income entered by the user.
Python 3 Programming Tutorial: Pressure.py
zhlédnutí 1,4KPřed 6 lety
A Python program that demonstrates reading input from the user, mathematical calculations, and generating output by converting from kilopascals to other pressure units.
Python 3 Programming Tutorial: Loan.py
zhlédnutí 7KPřed 6 lety
A Python program that demonstrates reading input from the user, mathematical calculations, and generating output (including formatting to a specific number of decimal places) by computing the payment amount and total cost of borrowing for a loan.
Python 3 Programming Tutorial: Average.py
zhlédnutí 5KPřed 6 lety
A Python program that demonstrates a while loop by reading a collection of numbers from the user and computing their average.
Python 3 Programming Tutorial: Gradient.py
zhlédnutí 5KPřed 6 lety
A Python program that demonstrates a for loop and computer graphics concepts by filling a window with a smooth color gradient.
Python 3 Programming Tutorial: Note.py
zhlédnutí 1KPřed 6 lety
A Python program that demonstrates writing and calling functions by drawing two music notes.
Python Programming Tutorial: Median.py
zhlédnutí 4,3KPřed 6 lety
A Python program that demonstrates lists by computing the median of a collection of values entered by the user.
Python Programming Tutorial: WordCount.py
zhlédnutí 2KPřed 6 lety
A Python program that demonstrates file I/O by computing the number of lines, words and chars in an input file and storing these statistics in an output file.

Komentáře

  • @Roxo_Vazio
    @Roxo_Vazio Před rokem

    this was a tremendous help thank you so much

  • @Intnho
    @Intnho Před rokem

    Sou iniciante e esse vídeo me ajudou muito, obrigado. ✍ I'm a beginner and this video helped me a lot, thank you.✍

  • @shyampurohit7307
    @shyampurohit7307 Před rokem

    upload the source code

  • @shaiknayeemsharafat2107

    send the code?

  • @diablo3053
    @diablo3053 Před 2 lety

    Damn, I've been searching for a concise and precise explanation for the last 10 hours . Thank you.

  • @razeeltaha7741
    @razeeltaha7741 Před 3 lety

    Thank you so much sirrr

  • @moisesalvarezgonzalez8965

    What if you’re trying to find how many month it’ll take for you to pay off the loan

    • @benscomputersciencevideos4701
      @benscomputersciencevideos4701 Před 3 lety

      The duration of the loan (in years) is entered by the user, so the duration in months is that value multiplied by 12.

  • @moisesalvarezgonzalez8965

    I have a quick question

  • @EasyCodesforKids
    @EasyCodesforKids Před 3 lety

    I’m trying to write a simple group of codes to teach python to middle schoolers. Thank you so much for this! I think these videos are a great group to start for my kiddos. Thank you so much!

  • @shamiran8038
    @shamiran8038 Před 3 lety

    Best Explanation found till now A big thanks

  • @fizixx
    @fizixx Před 3 lety

    You should have done so many more of these excellent videos!

  • @ashleyli2357
    @ashleyli2357 Před 4 lety

    just a quick question- what if the rates are fixed?

    • @benscomputersciencevideos4701
      @benscomputersciencevideos4701 Před 4 lety

      The line that reads the rate from the user could be replaced with a line that assigns a specific value to the rate variable. For example, replacing rate = float(input("Enter the annual interest rate percentage: ")) with rate = 3.5 would always use an interest rate of 3.5 percent.

    • @ashleyli2357
      @ashleyli2357 Před 4 lety

      @@benscomputersciencevideos4701 thanks so much !

  • @mickoyisrael6304
    @mickoyisrael6304 Před 4 lety

    Thank you for this! You explain it well keep it up bro!

  • @MrAverageViewer
    @MrAverageViewer Před 4 lety

    This is a great video! Just one question: What is the formula to add comma separators for thousandths?

    • @benscomputersciencevideos4701
      @benscomputersciencevideos4701 Před 4 lety

      Replace the final line in the example with: print("The total cost of borrowing is $" + format(total_cost, ",.2f") + ".") The string ",.2f" indicates that the value should be formatted so that it includes 2 digits to the right of the decimal and thousands separators.

    • @MrAverageViewer
      @MrAverageViewer Před 4 lety

      @@benscomputersciencevideos4701 Thank you so much for your response :) This helps tremendously!!

  • @vishalrasaily6597
    @vishalrasaily6597 Před 4 lety

    A thousand likes sir 👍👍👍👍👍👍👍👍👍👍

  • @chambagi
    @chambagi Před 4 lety

    Thank you very much for the thorough no fluff explanation.

  • @benderbendingrofriguez3300

    somehow the syntax of Python is very beautiful , more than C-Language,JavaScript.

  • @joaovitorjungblut5225

    Very helpful!

  • @devaneastman-pittam8815

    i have a similar problem for my freshman computer science class, this honestly helped me so much as i had gotten some of the numbers mixed up, so seeing this expandable and clear version helped me greatly.

  • @nityasree1844
    @nityasree1844 Před 5 lety

    command to install SimpleGraphics for python 3.7.2

    • @benscomputersciencevideos4701
      @benscomputersciencevideos4701 Před 5 lety

      SimpleGraphics can be downloaded from pages.cpsc.ucalgary.ca/~bdstephe/SimpleGraphics.py. If you save it in the same folder / directory where you saved the .py file for the program it should import without any trouble in Python 3. A tutorial document for drawing with SImpleGraphics can be found at pages.cpsc.ucalgary.ca/~bdstephe/SG_tutorial.pdf. A test program that draws several graphics primitives on the screen is available at pages.cpsc.ucalgary.ca/~bdstephe/SG_shapes_test.py.

  • @josephnwokotubo4910
    @josephnwokotubo4910 Před 5 lety

    it doesn't work after entering the first two values it returns the median

  • @MajorTrollerHAK
    @MajorTrollerHAK Před 5 lety

    Very thorough indeed.

  • @Fonster789
    @Fonster789 Před 5 lety

    esketit dr. Stephenson

  • @MajorTrollerHAK
    @MajorTrollerHAK Před 5 lety

    11/10 IGN recommended! “Solidified already mostly solid stuff” - “Me self”

  • @MajorTrollerHAK
    @MajorTrollerHAK Před 5 lety

    Once again, solid stuff me hearty!

  • @MajorTrollerHAK
    @MajorTrollerHAK Před 5 lety

    Great stuff matey!

  • @ousen3629
    @ousen3629 Před 5 lety

    Thank you professor Ben! c: