diff options
| author | mo khan <mo@mokhan.ca> | 2025-01-10 15:23:33 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-01-10 15:23:33 -0700 |
| commit | b23ced3867dce69427ea7e4f0e7c34d3db4709c7 (patch) | |
| tree | 82435248338428b0fdf76347ce98864f5f15990a | |
| parent | e3f674733c56624fa9b8ce48fbb2bbba3fb166b1 (diff) | |
Complete program 2 for project 2
| -rwxr-xr-x | projects/2/prog2.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/projects/2/prog2.py b/projects/2/prog2.py index cd8cd78..0de066b 100755 --- a/projects/2/prog2.py +++ b/projects/2/prog2.py @@ -5,3 +5,22 @@ Program author: mo khan ID: 3431709 Program 2 - Using Input """) + +# Read from stdin and assign value to a variable +string1 = input("Input string 1? ") + +# Read from stdin and assign value to a variable +string2 = input("Input string 2? ") + +# Read from stdin, convert to integer and assign value to a variable +int1 = int(input("Input integer A? ")) + +# Read from stdin, convert to integer and assign value to a variable +int2 = int(input("Input integer B? ")) + +print('') +# Print the concatenation of string1 and string2 +print('{}{}'.format(string1, string2)) + +# Print the result of multiplying int2 and int2 +print('{}'.format(int1 * int2)) |
