- 14
- 45 868
Ben's Computer Science Videos
Registrace 10. 10. 2013
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.
this was a tremendous help thank you so much
Sou iniciante e esse vídeo me ajudou muito, obrigado. ✍ I'm a beginner and this video helped me a lot, thank you.✍
upload the source code
Here's the code: pages.cpsc.ucalgary.ca/~bdstephe/CZcams/tax.py
send the code?
Here's the code: pages.cpsc.ucalgary.ca/~bdstephe/CZcams/tax.py
Damn, I've been searching for a concise and precise explanation for the last 10 hours . Thank you.
Thank you so much sirrr
What if you’re trying to find how many month it’ll take for you to pay off the loan
The duration of the loan (in years) is entered by the user, so the duration in months is that value multiplied by 12.
I have a quick question
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!
Best Explanation found till now A big thanks
You should have done so many more of these excellent videos!
just a quick question- what if the rates are fixed?
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.
@@benscomputersciencevideos4701 thanks so much !
Thank you for this! You explain it well keep it up bro!
This is a great video! Just one question: What is the formula to add comma separators for thousandths?
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.
@@benscomputersciencevideos4701 Thank you so much for your response :) This helps tremendously!!
A thousand likes sir 👍👍👍👍👍👍👍👍👍👍
Thank you very much for the thorough no fluff explanation.
somehow the syntax of Python is very beautiful , more than C-Language,JavaScript.
Very helpful!
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.
command to install SimpleGraphics for python 3.7.2
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.
it doesn't work after entering the first two values it returns the median
Very thorough indeed.
esketit dr. Stephenson
11/10 IGN recommended! “Solidified already mostly solid stuff” - “Me self”
Once again, solid stuff me hearty!
Great stuff matey!
Thank you professor Ben! c: