python3 -m http.server 8080
1. go to the relevant directory in your terminal and type this command
2. type ip and find the 192.168. etc.
3. go to the other computer and type into the browser: 192.168.x.x:8080
Posts tonen met het label python. Alle posts tonen
Posts tonen met het label python. Alle posts tonen
zondag 6 februari 2022
zaterdag 22 juli 2017
Polymorphism and inheritance
Inheritance refers to using the structure and behaviour of a super class in a subclass.
Polymorphism refers to changing the behaviour of a super class in the subclass.
https://stackoverflow.com/questions/6308178/what-is-the-main-difference-between-inheritance-and-polymorphism
vrijdag 22 januari 2016
Counting the number of characters in a string
# Counting the total number of the letter "a" in a string.
x = ("What shall we do with the drunken sailor?")
i = "a"
print (x.count(i, 0, 40))
Result:
3
x = ("What shall we do with the drunken sailor?")
i = "a"
print (x.count(i, 0, 40))
Result:
3
Print a line in reversal
# print the text in reversal.
import sys
x = ("What shall we do with the drunken sailor?")
y = (len(x)-1)
print (y)
while y > 0:
y = y - 1
sys.stdout.write(x[y])
print("\n")
Result:
40
rolias neknurd eht htiw od ew llahs tahW
import sys
x = ("What shall we do with the drunken sailor?")
y = (len(x)-1)
print (y)
while y > 0:
y = y - 1
sys.stdout.write(x[y])
print("\n")
Result:
40
rolias neknurd eht htiw od ew llahs tahW
Making an error in the text
# Hello World program in Python
x ="What shall we do with the drunken sailor?"
print (len(x))
print (x[0:5] +"hs"+ x[7:40])
Result: What hsall we do with the drunken sailor
x ="What shall we do with the drunken sailor?"
print (len(x))
print (x[0:5] +"hs"+ x[7:40])
Result: What hsall we do with the drunken sailor
Editing text with python
# editing text with python
x = ("What shall we do with the drunken sailor?\n")
print (x[0:4])
print (len(x))
print (x[40])
x = ("What shall we do with the drunken sailor?\n")
print (x[0:4])
print (len(x))
print (x[40])
Abonneren op:
Posts (Atom)
Enlarging Libreoffice window completely with command
You can open the LibreOffice window completely by pressing the CTRL+Shift+J keys together.
-
Als je een goede pdf wilt maken van een Volkskrant artikel, moet je als volgt te werken gaan. Open de Volkskrant pagina, waar je een pdf van...
-
You can open the LibreOffice window completely by pressing the CTRL+Shift+J keys together.
-
https://wiki.documentfoundation.org/Faq/Calc/113 Create a new LibreOffice Calc document. Click on a cell in the table (A1 for example) Go t...