FIFA-2022 Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
18.0k views
in RGPV/UTMP B.Tech (CSE-V Sem) Python Lab by Goeduhub's Expert (5.8k points)
retagged by
Python program to find the exponentiation of a number

1 Answer

0 like 0 dislike
by Goeduhub's Expert (5.8k points)
edited by
 
Best answer

Method 1

num=int(input("Enter number: "))

exp=int(input("Enter exponential value: "))

result=1

for i in range(1,exp+1):

    result=result*num

print("Result is:",result)

Output

Enter number: 2
Enter exponential value: 10
Result is: 1024

Method 2 using exponential operator (**)

num=int(input("Enter number: "))

exp=int(input("Enter exponential value: "))

result=num**exp

print("Result is:",result)

Output

Enter number: 8
Enter exponential value: 3
Result is: 512

Method 3 using in-built method

import math

num=int(input("Enter number: "))

exp=int(input("Enter exponential value: "))

result=math.pow(num,exp)

print("Result is:",result)

Output

Enter number: 3
Enter exponential value: 5
Result is: 243.0

For more RGPV/UTMP CSE V Sem Python Lab Experiments Click here


Click Here to go to all Universities Python Lab Index Pages.

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory

...