0% found this document useful (0 votes)
5 views1 page

Python Multiplication Table Script

The document contains a Python script that defines a function to print the multiplication table of a given number. It also includes a section that takes a command line argument to check if a provided number is even or odd. The script demonstrates basic input handling and function usage in Python.

Uploaded by

kavirajee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python Multiplication Table Script

The document contains a Python script that defines a function to print the multiplication table of a given number. It also includes a section that takes a command line argument to check if a provided number is even or odd. The script demonstrates basic input handling and function usage in Python.

Uploaded by

kavirajee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#save as mul.

py

def print_table(ourNum):

for x in range (1,11):

result=ourNum * x

print(ourNum," * ",x," = ",result)

#save as another filename

import mul

ourNum=int(input("Enter the table Number"))

mul.print_table(ourNum)

Command line Argument

import sys

print('Number of Arguments:',len([Link]))

num = int([Link][1])

if (num % 2) == 0:

print ('The number is even')

else:

print ('The provided number is odd')

You might also like