summaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
Diffstat (limited to 'projects')
-rwxr-xr-xprojects/2/prog2.py19
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))