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
Gabe wants to move text from one document to another document. He should _____.
Lorico [155]
Copy and paste the text
8 0
3 years ago
Read 2 more answers
Which approach is ideal for ensuring that a Webpage is maintained and does not appear neglected to users?
Greeley [361]

Answer:

D

Explanation:

I think putting hyperlink in essential pages is a good idea as it may guide a user

8 0
3 years ago
Why a design that doesn't fail initially fails after some time/use? identify at least 3 such mechanisms?
alina1380 [7]
Runs out of memory
has uninitialized    variables
uses  undefined behaviour

4 0
3 years ago
Challenge activity 6.1.3 function call with parameters
Kobotan [32]

Answer:

Printing formatted measurement Define a function PrintFeetinchShort, with int parameters numFeet and numinches, that prints using and "shorthand. End with a newline. Ex: PrintFeetinchShort(5, 8) prints: 5' 8" Hint: Use to print a double quote. ра 1 #include <stdio.hu 2 3 / Your solution goes here */ 4 5 int main(void) 6 int userFeet: 7 int user Inches: 8 9 scanf("%d", BuserFeet): 10 scanf("%d", Suser Inches); 11 12 PrintFeet InchShort(userFeet, user Inches); 13 14 return 0; 15) // Will be run with (5, 8), then (4, 11) Run

5 0
3 years ago
Please select all examples of systems using guided media. Group of answer choices ADSL 802.11 Wifi Home Networks Global Position
dusya [7]

Answer:

- ADSL.

- Ethernet Home Networks.

- Fiber Optics.

- Cable Television.

Explanation:

In Computer, Guided media also known as bounded media involves the use of cable such as fibre-optic cables, coaxial cable to transmit data signals from one system device to another.

Examples of systems using guided media are;

- ADSL.

- Ethernet Home Networks.

- Fiber Optics.

- Cable Television.

7 0
3 years ago
Other questions:
  • Sarah, a computer user, tells James, a computer technician, that the network she is connected to is running too slowly. Which of
    5·1 answer
  • MIDI is a A.technology based on placing brief digital recordings of live sounds under the control of a synthesizer keyboard. B.t
    10·1 answer
  • Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:
    11·1 answer
  • In the layers toolbar, which layer will appear in front of your game
    9·1 answer
  • ____ is the most widely used language for writing system software because it combines the power of a high-level language with th
    12·1 answer
  • why is there a need of properly interpreting teacher's/manufacturer's specifications before operating any food processing equipm
    9·1 answer
  • If we can lock a file, we can solve the race condition problem by locking a file during the check-and-use window, because no oth
    14·1 answer
  • Blair is the director of information systems at a marketing firm. She creates a set of guidelines that dictate everything an emp
    12·1 answer
  • Add me on blizzard none of my friends play ow<br> NADERJABER#2530
    8·1 answer
  • Which digital cellular standard is used widely throughout the world except the united states?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!