Skip to content

Commit db0e57f

Browse files
add a simple Python program
1 parent c0795de commit db0e57f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

hello.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# How to run this program:
2+
# In terminal, run $python3 hello.py
3+
4+
print("Hello world!")
5+
6+
txt = "Viel Glück!"
7+
print("Before encoding, txt: ", txt)
8+
print("After encoding with UTF-8, x: ", txt.encode()) # without specifiying encoding scheme, UTF-8 is used
9+
10+
print("After encoding with ascii, x: ", txt.encode(encoding="ascii",errors="namereplace"))
11+
12+
print("Program finished!")

0 commit comments

Comments
 (0)