Question

Write a python program to design a function with a parameter called A (which is between...

Write a python program to design a function with a parameter called A (which is between 1 and 10) and prints the multiplication table for 1 to A. • Note: Do not need to draw the horizontal and vertical lines. • Example for A = 10

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

def A(n):
    for i in range(1,n+1):
        for j in range(1,11):
            v = i * j#calculating the product
            print('{} * {} = {}'.format(i,j,v))
        print()#newline

A(5)

output for parameter value = 5:

Pratyushs-MacBook-Pro:python pthapli$ python3 main.py 1 * 1 = 1 1 * 2 = 2 1 * 3 = 3 1 * 4 = 4 1 * 5 = 5 1 * 6 = 6 1 * 7 = 7 1

Code screenshot:

Add a comment
Know the answer?
Add Answer to:
Write a python program to design a function with a parameter called A (which is between...
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
  • python program please Write a function called backwards which takes two parameters. The first is a...

    python program please Write a function called backwards which takes two parameters. The first is a file object that has already been opened in read mode called essayfile. The second is called filename, which contains the filename for the output file that will need to be properly opened and closed in your function. The function should read from already opened file object line by line. Each line in the file should have the words on the line reversed. For example,...

  • PYTHON 1- Write a function that receives a string value as a parameter, converts its first...

    PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.  

  • Write in Python This program: 1. Correct the compute_cells_state function which receives as parameter an array...

    Write in Python This program: 1. Correct the compute_cells_state function which receives as parameter an array of 2-dimensional booleans. The table is indexed online then in column.    A cell is called "alive" if the Boolean is true otherwise it is said that it is "dead".    Each cell to 8 "neighbors" (the 4 adjacent cells and the 4 cells diagonally)    The function modifies each cell according to the following rule:      - if the cell has 2 or 3 living neighbors she...

  • Write a function in Python called addressesthat will take an address value as parameter and print...

    Write a function in Python called addressesthat will take an address value as parameter and print it as a binary number, a hex number, and an integer decimal number on three separate lines. Include your code and evidence that it works in your homework submission. [Hint: The Python interpreter has a number of functions and types built intothe language that are always available. A few of these might be useful ;) Google: Python built-in functions.] You can use whichever Python...

  • In Python, write a program that asks the user for a positive integer number. If the...

    In Python, write a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number. For example, if the user enters 10, the output would look something like this. https://www.vectorstock.com/royalty-free-vector/multiplication-table-on-white-background-vector-2721686

  • write a function called average with the parameter called nums? P.S implement this in python language.

    write a function called average with the parameter called nums? P.S implement this in python language.

  • Write a Python function named print_nums that takes a single parameter, a list of float values,...

    Write a Python function named print_nums that takes a single parameter, a list of float values, and prints out the list on a single line.enclosed in brackets, each value with three places after the decimal point, the values separated by two spaces. You do not have to provide comments for this code. Example 1: print_nums([3/3, 4/3, 573, 6/3]) prints: [1.000 1.333 1.667 2.000] Example 2: print_nums([3]) prints: [3.000] Example 3: print_nums([]) prints: []

  • DATA PROGRAMMING: PYTHON Be sure to use sys.argv NOT input. Write a program and create a...

    DATA PROGRAMMING: PYTHON Be sure to use sys.argv NOT input. Write a program and create a function called inch2cm that takes one number in inches as a parameter, converts it to the centimeters and prints the result. The program output is shown below. Input: 14 Output: 14 inches = 35.56 centimeter Write a program and create the following functions: shapes(): takes the shape name and a number as parameters, and calls the proper function to calculate the area. areaCircle(): take...

  • Write a python program (recursive.py) that contains a main() function. The main() should test the following...

    Write a python program (recursive.py) that contains a main() function. The main() should test the following functions by calling each one with several different values. Here are the functions: 1) rprint - Recursive Printing: Design a recursive function that accepts an integer argument, n, and prints the numbers 1 up through n. 2) rmult - Recursive Multiplication: Design a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times...

  • Python program - Write a Python program, in a file called sortList.py, which, given a list...

    Python program - Write a Python program, in a file called sortList.py, which, given a list of names, sorts the names into alphabetical order. Use a one dimensional array to hold the list of names. To do the sorting use a simple sorting algorithm that repeatedly takes an element from the unsorted list and puts it in alphabetical order within the same list. Initially the entire list is unsorted. As each element is placed in alphabetical order, the elements in...

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
ADVERTISEMENT