clubs:python_club:python_club_ex_multiplication_table
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games
Table of Contents
Python Club Topics - Exercise: Multiplication table
Exercise: Multiplication Table
- Output: Display the multiplication table for a given number up to 10
- What you learn from the example:
- Code is done in order
- Comments used to describe the code
- Assign values to variables
- Use a for loop
- Print to the screen
Solution
[1] code:python show
# Multiplication table (from 1 to 10) in Python num = 12 # To take input from the user # num = int(input(“Display multiplication table of? ”)) # Iterate 10 times from i = 1 to 10 for i in range(1, 11): print(num, 'x', i, '=', num*i)
clubs/python_club/python_club_ex_multiplication_table.txt · Last modified: by 127.0.0.1
