Python Programming Final Lab Notes - Jupyter Notebook
Python Programming Final Lab Notes - Jupyter Notebook
9/5: This is a constant ratio used in the conversion formula. In decimal form, it equals 1.8.
When you multiply the Celsius temperature by 9/5, you scale it to fit the Fahrenheit
temperature scale.
This step adjusts the size of the temperature difference to match Fahrenheit degrees.
+ 32:
This adjustment aligns the scaled temperature with the Fahrenheit scale.
The Fahrenheit scale starts at a different point than the Celsius scale.
Adding 32 shifts the temperature to the correct position on the Fahrenheit scale.
Key Points:
1.Starting Values:
The series typically starts with 0 and 1. These two numbers are the first two terms.
2.Recursive Rule:
Each subsequent number in the series is the sum of the two previous numbers.
Mathematically, the nth term ( F_n ) can be defined as: [ F_n = F_{n-1} + F_{n-2} ]
With initial values: [ F_0 = 0 ] [ F_1 = 1 ]
3.Examples:
Simple Example:
Here’s a simple Fibonacci sequence:
except ValueError:
print("Please enter valid numbers.")
# Call the function
find_largest_number()
The sum of all prime numbers between 1 and 1000 is: 76127
Explanation:
Matrix multiplication is only possible when the number of columns in matrix A equals the
number of rows in matrix 𝐵
The program performs matrix multiplication by calculating the dot product of rows from
matrix
Enter coefficient a: 55
Enter coefficient b: 65
Enter coefficient c: 75
Two complex roots: -0.5909090909090909 + 1.007205445734561i, -0.5909090909
090909 - 1.007205445734561i
13. Program that accepts two strings S1, S2 and find whether they
are equal or not
return duplicates
# Example usage
input_list = [1, 2, 3, 4, 5, 3, 2, 6, 7, 8, 6, 9, 5]
# Find duplicates
duplicates = find_duplicates(input_list)
print(f"The duplicate elements in the list are: {duplicates}")
Buddy barks.
Whiskers meows.
In [ ]:
In [ ]: