Question

Write this in Python function multiplyItAgain(x, y) return x * y a = Python is great!...

Write this in Python

function multiplyItAgain(x, y) return x * y a = Python is great! /* set variable to 10 */ int b = 3 /* run a computation */ c = multiplyIt(a; b) System.out.println(c) /* run another computation */ c = multiplyIt(3; b) System.out.println(c)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def multiplyIt(x, y):
    return x * y


a = 'Python is great!'
b = 3
c = multiplyIt(a, b)
print(c)
c = multiplyIt(3, b)
print(c)
Add a comment
Know the answer?
Add Answer to:
Write this in Python function multiplyItAgain(x, y) return x * y a = Python is great!...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help correcting syntax with this python code function multiplyItAgain(x, y) retrn x * y...

    I need help correcting syntax with this python code function multiplyItAgain(x, y) retrn x * y a = Python is great! /* set variable to 10 */ int b = 3 /* run a computation */ c = multiplyIt(a; b) System.out.println(c) /* run another computation */ c = multiplyIt(3; b) System.out.println(c)

  • def max_of_two( x, y): ifx>y: return x returny a. Write a Python function called max_of_three( x,...

    def max_of_two( x, y): ifx>y: return x returny a. Write a Python function called max_of_three( x, y, z ) to return the largest numbers of three numbers passing to the function You can use the function max_of_two in your solution. /Your code

  • Write a function in python that takes a set A and a relation R(x, y) on...

    Write a function in python that takes a set A and a relation R(x, y) on A (as a python function such that R(x, y) returns true if and only if the relation xRy holds), and returns True if and only if the relation R is reflexive. Here is the function signature you need to use. def is reflexive(A, R): You can test your code as follows. s = {1,2,3} def y(x, y): return x == y def n(x, y):...

  • Using python, Write a function that takes 3 inputs, x, y, and z, but make y...

    Using python, Write a function that takes 3 inputs, x, y, and z, but make y and z default parameters, with initial values of 5 and 12. Have the function return the sum of x, y, and z

  • Look at the following function definition: def my_function(x, y): return x[y] a. Write a statement that...

    Look at the following function definition: def my_function(x, y): return x[y] a. Write a statement that calls this function and uses keyword arguments to pass ‘testing’ into x and 2 into y. b. What will be printed when the function call executes? 6. Write a statement that generates a random number in the range I'm using python to solve this this is what i did def main():      result= my_function(x='testing', y=2)      print(result) def my_function(x,y):      return x[y] main()

  • 1. In Python, Write a function to convert inches into yards, feet and inches. The functions...

    1. In Python, Write a function to convert inches into yards, feet and inches. The functions should take one parameter, 'inches', and print out the number of yards, feet, and inches equivalent to the value of the argument. Call the function after prompting the user to enter the number of inches. Don't forget to convert the input to an 'int'. 2. In Python,Write a function to convert celsius to fahrenheit. The function should return a value, which you should assign...

  • Consider the following Python program: def fun(x, y): return x + y # [2] # [1]...

    Consider the following Python program: def fun(x, y): return x + y # [2] # [1] a = fun(2, 3) b = fun("2", 3) print a, b What does it evaluate to? Replace the last statement print a, b with print a + b and explain the traceback. What's wrong? Now eliminate the line marked [1] and change line [2] to read return x + y. Run the program and explain the traceback. Consider the following definition: def fun(n, m):...

  • Python Write a function that takes in two numbers as parameters. The function will then return...

    Python Write a function that takes in two numbers as parameters. The function will then return the value of the first parameters squared by the second parameter. Print the value of the return statement. Take a screenshot of both your code and your properly executed code after you have run it. Submit the screenshots here along with your .txt file.

  • (Python) Write a python function that takes a binary search T and a range [a, b]...

    (Python) Write a python function that takes a binary search T and a range [a, b] with a ≤ b, where a,b are two integers, and has to decide whether there are two different keys k1,k2 in T whose sum belongs to the given range [a, b] or not. For instance, if the input to the function is some BST T and the range [−1, 4], the function has to decide whether there are two distinct keys k1 , k2...

  • Part 1: Using Idle Write a Python Script that Does the Following 1. At the top...

    Part 1: Using Idle Write a Python Script that Does the Following 1. At the top of your program, import the math library as in from math import * to make the functions in the math module available. Create a variable and assign into it a constant positive integer number of your choice. The number should be at most 10. 1 Suppose we call this variable x for this writeup document Try something like x = 4 2. Create another...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT