aboutsummaryrefslogtreecommitdiff
path: root/src/Lecture4/live/live1.py
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-05-25 17:10:49 +0200
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-05-25 17:10:49 +0200
commitd6c61d988bfa4255baf9cdae42db59ebee38363f (patch)
tree118ff3c2424e735149c145524965a4a337e50beb /src/Lecture4/live/live1.py
parent46eef66b1e1571c77dc828d7e950b129b4c8bfd0 (diff)
downloadmathsoftware-d6c61d988bfa4255baf9cdae42db59ebee38363f.tar.gz
mathsoftware-d6c61d988bfa4255baf9cdae42db59ebee38363f.zip
Added files
Diffstat (limited to 'src/Lecture4/live/live1.py')
-rw-r--r--src/Lecture4/live/live1.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Lecture4/live/live1.py b/src/Lecture4/live/live1.py
new file mode 100644
index 0000000..da505f2
--- /dev/null
+++ b/src/Lecture4/live/live1.py
@@ -0,0 +1,17 @@
1print(2+2)
2
3x = input("Input something: ")
4print("Your input was:", x, "of type", type(x))
5
6x_number = int(x)
7print("Converted to a number:", x_number, "of type", type(x_number))
8
9if x_number > 10:
10 print("Your number was large!")
11 print("It was larger than 10")
12 z = x_number-10
13 print("This is a smaller number:", z)
14else:
15 print("Your number was small")
16
17print("Bye")

Generated with cgit - Back to sebastiano.tronto.net