InterviewSolution
Saved Bookmarks
| 1. |
Write a program using a for loop, that calculates exponentials. Your program should ask for base and exp. value from user. |
|
Answer» x = input (“Enter a base number”) y = input (“Enter a exp. number”) if y > 0 : for x in range (y) : x = x * x else for x in range (y) : x = 1/x * x print x |
|