1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
LekaFEV [45]
4 years ago
6

Write a Python program to: ask the user to enter two integers: int1 and int2. The program uses the exponential operator to calcu

late and then print the result when int1 is raised to the int2 power. You also want to calculate the result when int1 is raised to the .5 power; however, you realize that it is not possible to take the square root of a negative number. If the value for int1 that is entered is a negative number, print a message to the user explaining why you cannot complete the task. Otherwise, calculate the square root and print it. Finish the program by printing the values of int1 and int2.
Computers and Technology
1 answer:
Triss [41]4 years ago
4 0

Answer:

int1=int(input("Enter integer :\n"))#taking input of first number.

int2=float(input("Enter the power :\n"))#taking input of the power.

if int2 == 0.5 and int1<0:#condition for negative square root.

   print("Cannot calculate the square root of negative numbers")#printing the message.

else:#else calculating the result.

   res=int1**int2

   print(res)

output:-

Enter integer :

-5

Enter the power :

0.5

Cannot calculate the square root of negative numbers

Explanation:

In the above program I have taken input of the number and the power.Since power can be decimal number taking it as float.If the number is negative and the power is 0.5 then printing the message for not calculating the value else calculating the value and storing it in the res printing the res.

You might be interested in
mapa mental con la explicación de que medios de comunicación y redes sociales intervienen en la construcción de tu identidad​
lisov135 [29]

Answer:

este presente yo cuando me pidieron eso

5 0
3 years ago
A mobile device you are troubleshooting is experiencing a sharp decrease in performance after an hour of operation. The user pow
Anna71 [15]

Answer:

Close or disable all unused running apps.

Explanation:

Closing programs running in the background on your computer or mobile device helps to free up system resources for your other programs. These problems can be resolved where your system is running slowly or two programs are trying to use the same device hence causing the device or system to drag.

5 0
3 years ago
An algorithm to display multiplication table a number up to 12​
kkurt [141]

Explanation:

Explanation:They are

Explanation:They are 1) start the process

Explanation:They are 1) start the process 2) Input N, the number for which multiplication table is to be printed

Explanation:They are 1) start the process 2) Input N, the number for which multiplication table is to be printed 3) For T = 1 to 10

Explanation:They are 1) start the process 2) Input N, the number for which multiplication table is to be printed 3) For T = 1 to 104) print M = N*T

Explanation:They are 1) start the process 2) Input N, the number for which multiplication table is to be printed 3) For T = 1 to 104) print M = N*T5) End for

Explanation:They are 1) start the process 2) Input N, the number for which multiplication table is to be printed 3) For T = 1 to 104) print M = N*T5) End for6) Stop the process

4 0
3 years ago
To create a multi-column and multi-row box for users to type into in an html form, use the ____________ tag pair
alexgriva [62]

To create a multi-column and multi-row box for users to type into in an html form, use the <textarea></textarea> tag pair.

<span>The html tags are the codes or the hidden keywords in the web browser to tell about its format and displayed content. The html tags mostly comes in pairs, pair consist of the start tag and end tag.</span>
4 0
3 years ago
Dns (domain name system) servers translate all domain names into _____. hypermedia cookies ip addresses proxy servers
sweet-ann [11.9K]
<span>Dns (domain name system) servers translate all domain names into </span>ip addresses
4 0
4 years ago
Other questions:
  • The operating system is not directly involved in one of these tasks.Immersive Reader
    12·1 answer
  • It is a function that ends the connection to the database.
    9·2 answers
  • Which best describe a resource each student could use to find information
    6·2 answers
  • Many computer magazines and Web sites present comparisons of several DBMSs. Find one such DBMS comparison article and compare th
    10·1 answer
  • You wrote a C application that takes 20 seconds using your desktop processor. An improved C compiler is released that requires o
    6·1 answer
  • Ayuda por favor.<br><br>Please help!!
    15·1 answer
  • Help pls. Computer basics.
    5·2 answers
  • Inserting and deleting text is a basic editing task in word processing.<br><br> True or false
    6·2 answers
  • Rideshare companies like Uber or Lyft track the x,y coordinates of drivers and customers on a map. If a customer requests a ride
    5·1 answer
  • 4. What is the formula for calculating the file size?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!