A collection of Exercise and questions from the Scientific Computing with Python course solved
is a Clinical Professor at the University of Michigan School of Information, where he teaches various technology-oriented courses including programming, database design, and Web development.
Bio page | Python for Everybody page | Python FreeCodeCamp course
Some questions from the course aren't included in this repository, because they were simpler.
See exercise
-
class 3 Introduction: Python as a Language
Introduction to Python programming, syntax errors and python instructions
-
class 4 Introduction: Elements of Python
Explanation of the learning process, reserved words, sentences, scripts and program steps or flow
-
class 6 Intermediate Expressions
Explanation of the numeric expressions, data types, type conversions and user input.
02 - 02 EX - Python for Everybody Course: Write a program that uses input to pompt a user for their name and welcome them.
02 - 03 EX - Python for Everybody Course: Write a program to prompt the user for hours and rate per hour to compute gross pay. -
class 7 Conditional Execution
Explanation of the if statement, conditional steps, comparison operators, indentation and nested conditionals.
-
class 8 More Conditional Structures
Explanation of more conditional statements and try / except structure.
03 - 01 EX - Python for Everybody Course: Rewrite your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours.
03 - 02 EX - Python for Everybody Course: Rewrite your pay program usin try and except so that your program handles non-numeric input gracefully by printing a message and exiting the program. The following shows two executions of the program. -
class 10 Build your own Functions
Explanation of the function creation process, how to define them, arguments, parameters and return values.
04 - 06 EX - Python for Everybody Course: Rewrite your pay computation with time-and-a-half for overtime and create a funtion called computepay which takes two parameters ( hours and rate).
-
class 11 Loops and Iterations
Explanation of the iteration process, infinite loops and iteration with continue.
-
class 12 Iterations: Definite Loops
Explanation of the for loop, in keyword and iterable variables.
-
class 13 Iterations: Loop Idioms
Explanation of the loop construction and looping to find the largest number in a set.
-
class 14 Iterations: More Patterns
Explanation of counting, summing in a loop, searching using a boolean variable.
05 - 01 EX - Python for Everybody Course: Write a program which respeactly reads numbers until the user enters "done". Once "done" is entered, print out the total, count, and average of the numbers. If the user enters anything other than a number, detect their mistake using try and except and print an error message and skip to the next number.
-
class 15 Strings in Python
Explanation of the string data type, len() function and looping through strings.
-
class 16 Intermediate Strings
Explanation of the function creation process, how to define them, arguments, parameters and return values.
06 - 05 EX - Python for Everybody Course: Take the following Python code that storesa string:
str = 'X-DSPAM-Condidence: 0.8475 '
Use find and string slicing to extract the portion of the string after the colon character and then use the float function to convert the extracted string into a floating point number
-
class 18 Files as a Sequence
Explanation of file treatment as a sequence and how to read files and their content.
07 - 01 EX - Python for Everybody Course: Write a program to read through a file and print the contents of the file ( line by line ) all in upper case.
-
class 19 Python Lists
Explanation of the algorithms, data structures, collections, lists and range() function.
-
class 21 Strings and Lists
Explanation of the uses of the lists of strings and the double split pattern.
08 - EX - Python for Everybody Course: debugging code.
-
class 22 Python Dictionaries
Explanation of the dictionaries and their differences with the lists.
-
class 23 Dictionaries: Common Applications
Explanation of the common applications of dictionaries, histograms and get() method.