diff --git a/webpages/__pycache__/navigation.cpython-312.pyc b/webpages/__pycache__/navigation.cpython-312.pyc index eb086871b..4204965e3 100644 Binary files a/webpages/__pycache__/navigation.cpython-312.pyc and b/webpages/__pycache__/navigation.cpython-312.pyc differ diff --git a/webpages/input_code.py b/webpages/input_code.py index 01b5d9e94..1d23f8784 100644 --- a/webpages/input_code.py +++ b/webpages/input_code.py @@ -1,32 +1,12 @@ -# sample function without input arguments and return values -def print_hello(): - print('Hello WT!') +# Example 3: Demonstrating basic arithmetic operations +a = 10 # Assigns integer 10 to variable 'a' +b = 3 # Assigns integer 3 to variable 'b' +c = 2.5 # Assigns floating-point number 2.5 to variable 'c' -# type function name to call the function directly. -print_hello() -print_hello() -print_hello() -# sample function with input arguments and return value -def tree_sum(a,b,c): - result = a+b+c - return result - -# call function with given values and use another variable to hold return values -sum1 = tree_sum(1,2,3) -sum2 = tree_sum(4,5,6) - -print('sum1: ', sum1) -print('sum2: ', sum2) - -# sample function with multiple return values -def sum_len(num_list): - total = 0 - for num in num_list: - total = total+num - return total, len(num_list) - -num_list = [0,1,2,3,4,5,6,7,8,9] -# t is a variable used to hold returned total -# l is a variable used to hold returned length: len(num_list) -t,l = sum_len(num_list) -print(f'The length of list is: {l}; the sum of list is: {t}') \ No newline at end of file +print('Addition: ', a + b) # Prints the sum of 'a' and 'b' +print('Subtraction: ', a - b) # Prints the result of subtracting 'b' from 'a' +print('Multiplication: ', a * b) # Prints the product of 'a' and 'b' +print('Multiplication: ', a * c) # Prints the product of 'a' and 'c', demonstrating integer-float multiplication +print('Division: ', a / b) # Prints the division of 'a' by 'b', result is a float +print('Floor Division: ', a // b) # Prints the floor division of 'a' by 'b', removing digits after the decimal point +print('Modulus: ', a % b) # Prints the remainder of 'a' divided by 'b' \ No newline at end of file diff --git a/webpages/navigation.py b/webpages/navigation.py index 48a3a34bc..7b42b184c 100644 --- a/webpages/navigation.py +++ b/webpages/navigation.py @@ -12,7 +12,6 @@ def navigation_bar(): st.image("./images/BuffTeksLogo.png", caption="Building Skills, Crafting Code, Bridging Communities") page_label = sac.menu([ - sac.MenuItem("Testing", icon='fingerprint'), sac.MenuItem('Homepage', icon='house'), sac.MenuItem('BuffTeks Project', icon='bi bi-laptop'), sac.MenuItem('BuffTeks Event', icon='calendar-event'), @@ -25,6 +24,7 @@ def navigation_bar(): sac.MenuItem('Lesson3', icon='3-square'), ]), ]), + sac.MenuItem("Testing", icon='fingerprint'), sac.MenuItem(type='divider'), sac.MenuItem('Link', type='group', children=[ sac.MenuItem('Join Us', icon='person-plus', href='https://wtamuuw.az1.qualtrics.com/jfe/form/SV_2boQtKLCptO33HE'),