Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# Get user input for the first integer user _ num = int ( input ( Enter integer: ) ) # Task 1

# Get user input for the first integer
user_num = int(input("Enter integer:
"))
# Task 1: Output the user's input
print("You entered:", user_num)
# Task 2: Output the input squared and cubed
squared = user_num * user_num
cubed = user_num * user_num * user_num
print(user_num, "squared is", squared)
print("And", user_num, "cubed is", cubed, "!!")
# Get user input for the second integer
user_num2= int(input("Enter another integer:
"))
# Task 3: Output the sum and product of the two integers
sum_result = user_num + user_num2
product_result = user_num * user_num2
print(user_num, "+", user_num2,"is", sum_result)
print(user_num, "*", user_num2,"is", product_result)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data With Hadoop MapReduce A Classroom Approach

Authors: Rathinaraja Jeyaraj ,Ganeshkumar Pugalendhi ,Anand Paul

1st Edition

1774634848, 978-1774634844

Students also viewed these Databases questions