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]
3 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]3 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
Sharon's company has written a new computer program, and she has been asked to find a way to prevent people from copying the sof
Tasya [4]

Answer:

Sharon's company has written a new computer program, and she has been asked to find a way to prevent people from copying the software they purchase and giving it to others who have not purchased the software. What can Sharon's company do to make sure a customer who p…

A:

Use DRM.

Explanation:

Use DRM.

8 0
2 years ago
Which one is not the part of motherboard ?<br>O Registers<br>O<br>Bus<br>O<br>Port<br>O<br>none​
Svetradugi [14.3K]

Answer:

can you expand on your question?

5 0
3 years ago
Creative Commons Question -- At home, you created a really great digital song, audio jingle, or music track using some software
galina1969 [7]
C. It's honestly up to the user, upload so others can use it or make it so its copyrighted and make some cash :P
6 0
2 years ago
Given the following narrative for Bambino’s Pizzeria, list the actors that should be used in the use-case diagram.
Andreyy89

Answer:

See explaination

Explanation:

Please kindly check attachment for the diagram in its best detailed manner.

8 0
3 years ago
Công dụng của đồng hồ đo điện:vôn kế, ampe kế, oát kế
Lostsunrise [7]

Answer:

I wonder what are you saying?

Explanation:

Please give me brainliest :)

4 0
2 years ago
Other questions:
  • A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the en
    14·1 answer
  • Python
    14·1 answer
  • Face book requires you to change your password regularly<br> a. TRUE<br> b. FALSE
    14·1 answer
  • I have a problem with Instagram.
    11·1 answer
  • When Gina was 10, she swam in the ocean for the first time. She remembers the feeling of kicking her feet, slicing her arms thro
    12·1 answer
  • Sally types documents that have a few numbers but mostly letters. To enter these numbers, she should use the
    12·1 answer
  • fun fact about London(me): when it comes to relationships she becomes clingy to the person shes dating
    10·1 answer
  • Write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. Your program should print each nu
    11·1 answer
  • How many operations can a computer perform every second?
    13·1 answer
  • Write a two to three sentence response to the following question:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!