I have the following code: import math inputs = input("").split() n = int(inputs[0]) r = float(inputs[1]) if n % 2 == 0 and r > 0: output = (math.pi**(n/2) / math.gamma(n/2 + 1)) * (r**n) print(output) else: print("Conditions not met. Please ensure n is odd and r is greater than 0.") my problem is it works fine in jupyter notebook but nothing happens in spyder and I have no idea why, just as reference I have attached the assignment as image.
I have the following code: import math inputs = input("").split() n = int(inputs[0]) r = float(inputs[1]) if n % 2 == 0 and r > 0: output = (math.pi**(n/2) / math.gamma(n/2 + 1)) * (r**n) print(output) else: print("Conditions not met. Please ensure n is odd and r is greater than 0.") my problem is it works fine in jupyter notebook but nothing happens in spyder and I have no idea why, just as reference I have attached the assignment as image.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 22PE
Related questions
Question
I have the following code:
import math
inputs = input("").split()
n = int(inputs[0])
r = float(inputs[1])
if n % 2 == 0 and r > 0:
output = (math.pi**(n/2) / math.gamma(n/2 + 1)) * (r**n)
print(output)
else:
print("Conditions not met. Please ensure n is odd and r is greater than 0.")
my problem is it works fine in jupyter notebook but nothing happens in spyder and I have no idea why, just as reference I have attached the assignment as image.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr