Day 5: Loops

  • Instructions:
    • print the first 10 multiples of n x i using the format n x i = result
    • Constraints:
      • 1 <= i <= 10
      • 2 <= n <= 20
    Excercise
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    #!/bin/python3
    
    import math
    import os
    import random
    import re
    import sys
    
    if __name__ == '__main__':
        n = int(input().strip())
    
    Solution
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    #!/bin/python3
    
    import math
    import os
    import random
    import re
    import sys
    
    if __name__ == '__main__':
        n = int(input().strip())
        for i in range(1,11):
            print("{} x {} = {}".format(n,i,n * i))