Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could you please answer these using python? 1. Straight-line Calculations Write a script (program) that calculates and prints the following values: 25 -33 (10 +9
Could you please answer these using python?
1. Straight-line Calculations Write a script (program) that calculates and prints the following values: 25 -33 (10 +9 + 8+ 7)12 (4567 + 65432)123 2. Input Function We can invoke the function input to read values from the console. input will have a single argument, which is the string that serves as a prompt. An example is x-input ("Give me a number: ") print (5*x) The output of this script is a bit surprising unless one realizes that the value assigned to variable x is a string. We can change the type by using int, float, or str. For example, a string x can be made into an integer by saying int (x) . Thus, we can change our program to x-int (input("Give me a number: ")) print (5*x) where we convert the output of input into an integer eate the following pro ith your partner: 1. A program asks the user for a length in miles and returns the length in kilometers 2. A program that asks the user for area in square feet and converts it into square meters A program that asks the user for number of years and converts that into seconds. 3. 3. Using Pre-Defined Functions Write a script (program) that prompts the user for a text and then returns the number of letters in the text. 4. Using Math Module Write a script that asks the user for a number. It then prints out the sine of this number interpreted as a degree. The sin function in the math module uses radians, so you need to translate the user input by dividing by 180 and multiplying byStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started