Please Use Python and provide explanations!!!!
1. Write a function called multiply_and_print that takes two numbers, multiplies them together, and prints out the sentence '____ times ____ is ____'. Ask the user for two numbers, and call multiply_and_print with their two numbers as arguments.
2.Write a function called roll_dice that rolls two six-sided dice and prints out the result of each die. Call it three times. (Remember, you can import the random module with the statement import random, and then use the function random.randint to get a random integer between the first and second argument, inclusive.)
def multiply_and_print(n1, n2):
print("{} times {} is {}".format(n1, n2, n1 * n2))
n1 = int(input("Enter a number: "))
n2 = int(input("Enter another number: "))
multiply_and_print(n1, n2)

import random
def roll_dice():
print(random.randint(1, 6), 'and', random.randint(1, 6))
roll_dice()
roll_dice()
roll_dice()
Please Use Python and provide explanations!!!! 1. Write a function called multiply_and_print that takes two numbers,...
How to write python code that is a dice rolling function that generates random numbers. The dice rolling function takes two arguments: the first argument is the number of sides on the dice and the second argument is the number of dice. The function returns the sum of the random dice rolls. For example, if I call roll dice(6,2) it might return 7, which is the sum of randomly chosen numbers 4 and 3. It somewhere along the lines of:...
This problem investigates how you can use random numbers to simulate a computer dice game write a function called twooice that simulates the rolling of two sik-sided dice. The function takes no inputs. Instead, it generates two random integers between 1 and 6, and output their sum. You may submit your work as many times as you want Try to get 100%) Your Function MATLAB Documentation Reset Code to call your function C Reset 1s-tuoDice ss-twoDice
This problem investigates how...
"PYTHON" 1. a. Create a file (module) named camera_picture.py. b. Write a function, take_picture_effect, that takes two parameters, the filename and an effect. c. Take a picture with the filename and effect. Use camera.effect to set the effect. Use help(PiCamera) to find the effects which you can apply. d. Create a second file use_camera.py. e. Import the take_picture_effect function from the camera_picture module. f. Prompt the user for the filename. g. Prompt the user for the image_effect. help(PiCamera) to see...
With using Python . Write a function that: 1. Takes two arguments and returns the product of the arguments. The return value should be of type integer. 2. Takes two arguments and returns the quotient of the arguments. The return value should be of type float. 3. Takes one argument and squares the argument. It then uses the two values and returns the product of the two arguments.(Reuse function in 1.) 4. Takes one argument and prints the argument. Use...
Greeter Write a function that takes in a person's name, and prints out a greeting. The greeting must be at least three lines, and the person's name must be in each line. example: Hello name How are you do name Nice to meet you name Use your function to greet at least three different people. Full Names Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a...
Python: Write a func that will create a list of random numbers. The function will take in two parameters. The first parameter specifies how many values to generate and the second parameter is the highest random # (2 is the minimum) that the func generates. To get the random numbers, you may use this line of code: y = random.randint (2,max), where max is the highest possible random #, INCLUSIVE.
Write a Python function, called counting, that takes two arguments (a string and an integer), and returns the number of digits in the string argument that are not the same as the integer argument. Include a main function that inputs the two values (string and integer) and outputs the result, with appropriate labelling. You are not permitted to use the Python string methods (such as count(), etc.). Sample input/output: Please enter a string of digits: 34598205 Please enter a 1-digit...
Write a program (python) that multiplies two hard-coded numbers, then prints the individual numbers out and prints their product out, all on separate lines. You can choose the two numbers that are multiplied together. Make a copy of previous exercise then modify it to print output exactly like this, rather than just the numbers on separate lines: 10 x 7 = 70 Do this using the string.format() function discussed in the lecture.
Create a Dice Game: PYTHON This game is between two people. They will roll a pair of dice each 10 times. Each roll will be added to a total, and after 10 rolls the player with the highest total will be the Winner! You will use the RANDOM class RANDRANGE to create a random number from 1 to 6. You'll need a function for "rollDice" to roll a pair of dice and return a total of the dice. You must...
PYTHON 4. Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repetition structure (a While or For loop) to print strText intNumber of times. Call this function. 5. Get an input from the user that is a file name with an extension (e.g., "myfile.ipynb" or "myfile.txt"). Print only the characters that follow the "." in the file name (e.g., "ipynb" and "txt"). 6. Ask the user for 5...