Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using Python, help me with the code, thanks. rocedure For this activity we will be creating Python programs using the Spyder IDE. Functions Exploring built-in

using Python, help me with the code, thanks. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
rocedure For this activity we will be creating Python programs using the Spyder IDE. Functions Exploring built-in functions 1. Create a folder named builtinfunctions 2. Create a Python file inside the functions folder named evaluator.py and copy the code shown below. Proposition Logic motor for discrete math for 2-3 variable print("Propositional logic evaluator for discrete math) variables - int (input("How many variables? >> total_combinations = 2**variables combinations_list = [] store all the possible combination #generate the combinations for i in range(total_combinations): bin_equivalent bin() [2:] while len(bin_equivalent)>>>>/2" *2 = (complex(-b, -1sath.floor(math.sert(abs(2-(4*2*c)>>>>>/2a return 2, X2 else! xi. (breath.sqrt(2-(4-'c)))/(2a) *2 = (-b-math.art(b2-(****)}/(2a) return x, X2 Court fort.2.2) print (quadratic_formula(1,2,3) 3. Run the program and observe the output. You may switch between the two sets of values. 4. Create a new Python file called mathmodule2.py and copy the following codes as shown below: import nath def angle_demo(): angle. math.sin(math.pi/2) thefault out some ke slagres in relas print(angle) to comment, went to trade angle = math.sin(math.radians(90)) print(angle) this forced the trend perbolic functions angle_demo) 5. To view additional functions in the module. Type and run help{math) while it is imported. User-defined Modules Horint(current date() 4. Run the main.py program again and you will now see the correct output which is the current time. 5. Modify the main.py to also display the current date using the current_date() in dateandtime.py 6. To remove the need to constantly indicate the module name dateandtime. in each function, modify the code as shown below: from dateandtime import current_time, current_date print("The current time is", current_time()) print("The current time is", current_date()) rocedure For this activity we will be creating Python programs using the Spyder IDE. Functions Exploring built-in functions 1. Create a folder named builtinfunctions 2. Create a Python file inside the functions folder named evaluator.py and copy the code shown below. Proposition Logic motor for discrete math for 2-3 variable print("Propositional logic evaluator for discrete math) variables - int (input("How many variables? >> total_combinations = 2**variables combinations_list = [] store all the possible combination #generate the combinations for i in range(total_combinations): bin_equivalent bin() [2:] while len(bin_equivalent)>>>>/2" *2 = (complex(-b, -1sath.floor(math.sert(abs(2-(4*2*c)>>>>>/2a return 2, X2 else! xi. (breath.sqrt(2-(4-'c)))/(2a) *2 = (-b-math.art(b2-(****)}/(2a) return x, X2 Court fort.2.2) print (quadratic_formula(1,2,3) 3. Run the program and observe the output. You may switch between the two sets of values. 4. Create a new Python file called mathmodule2.py and copy the following codes as shown below: import nath def angle_demo(): angle. math.sin(math.pi/2) thefault out some ke slagres in relas print(angle) to comment, went to trade angle = math.sin(math.radians(90)) print(angle) this forced the trend perbolic functions angle_demo) 5. To view additional functions in the module. Type and run help{math) while it is imported. User-defined Modules Horint(current date() 4. Run the main.py program again and you will now see the correct output which is the current time. 5. Modify the main.py to also display the current date using the current_date() in dateandtime.py 6. To remove the need to constantly indicate the module name dateandtime. in each function, modify the code as shown below: from dateandtime import current_time, current_date print("The current time is", current_time()) print("The current time is", current_date())

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ai And The Lottery Defying Odds With Intelligent Prediction

Authors: Gary Covella Ph D

1st Edition

B0CND1ZB98, 979-8223302568

More Books

Students also viewed these Databases questions