diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-25 17:10:49 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2021-05-25 17:10:49 +0200 |
| commit | d6c61d988bfa4255baf9cdae42db59ebee38363f (patch) | |
| tree | 118ff3c2424e735149c145524965a4a337e50beb /src/Lecture4/live/live1.py | |
| parent | 46eef66b1e1571c77dc828d7e950b129b4c8bfd0 (diff) | |
| download | mathsoftware-d6c61d988bfa4255baf9cdae42db59ebee38363f.tar.gz mathsoftware-d6c61d988bfa4255baf9cdae42db59ebee38363f.zip | |
Added files
Diffstat (limited to '')
| -rw-r--r-- | src/Lecture4/live/live1.py | 17 |
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 @@ | |||
| 1 | print(2+2) | ||
| 2 | |||
| 3 | x = input("Input something: ") | ||
| 4 | print("Your input was:", x, "of type", type(x)) | ||
| 5 | |||
| 6 | x_number = int(x) | ||
| 7 | print("Converted to a number:", x_number, "of type", type(x_number)) | ||
| 8 | |||
| 9 | if 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) | ||
| 14 | else: | ||
| 15 | print("Your number was small") | ||
| 16 | |||
| 17 | print("Bye") | ||
