Raspithek
2 years ago
12 changed files with 75 additions and 0 deletions
@ -0,0 +1 @@ |
|||||
|
partner/__pycache__ |
@ -0,0 +1,9 @@ |
|||||
|
class Anschrift: |
||||
|
def __init__(self, strasse, hausnummer, plz, ort): |
||||
|
self.strasse = strasse |
||||
|
self.hausnummer = hausnummer |
||||
|
self.plz = plz |
||||
|
self.ort = ort |
||||
|
|
||||
|
def __str__(self): |
||||
|
return f'{self.strasse} {self.hausnummer} \n {self.plz} {self.ort}' |
@ -0,0 +1 @@ |
|||||
|
__pycache__ |
@ -0,0 +1,25 @@ |
|||||
|
from namen import namen |
||||
|
|
||||
|
### String nach Boolean |
||||
|
print('String nach Boolean') |
||||
|
print(bool('True')) # ist True |
||||
|
print(bool('Test')) # ist True |
||||
|
print(bool('False')) # ist True |
||||
|
print(bool('')) # ist False |
||||
|
|
||||
|
### int nach Boolean |
||||
|
print('int nach Boolean') |
||||
|
print(bool(0)) # ist False |
||||
|
print(bool(1)) # ist True |
||||
|
print(bool(2)) # ist True |
||||
|
|
||||
|
### List nach Boolean |
||||
|
print('List nach Boolean') |
||||
|
print(bool(namen)) # ist True |
||||
|
print(bool([])) # ist False |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
some_chars = [65,66,67,68] |
||||
|
|
||||
|
print(bytearray('Homer',encoding='utf-8')) |
||||
|
print(bytearray(some_chars)) |
@ -0,0 +1,4 @@ |
|||||
|
some_chars = [65,66,67,68] |
||||
|
|
||||
|
print(bytes('Homer', encoding='utf-8')) |
||||
|
print(bytes(some_chars)) |
@ -0,0 +1,9 @@ |
|||||
|
|
||||
|
|
||||
|
eingabe = input('Dein Alter (Jahre): ') |
||||
|
|
||||
|
alter = int(eingabe) |
||||
|
|
||||
|
|
||||
|
print(f'Du bist {alter} Jahre alt.') |
||||
|
|
@ -0,0 +1 @@ |
|||||
|
namen = ["Homer", "Marge", "Bart"] |
@ -0,0 +1,5 @@ |
|||||
|
from namen import namen |
||||
|
|
||||
|
|
||||
|
print(set(namen)) |
||||
|
print(set("Jimbo")) |
@ -0,0 +1,10 @@ |
|||||
|
|
||||
|
wert = 3 |
||||
|
|
||||
|
#str = 'Die ' + wert + ' Musketiere' |
||||
|
|
||||
|
|
||||
|
str = 'Die ' + str(wert) + ' Musketiere' |
||||
|
|
||||
|
print(str) |
||||
|
|
@ -0,0 +1,4 @@ |
|||||
|
from namen import namen |
||||
|
|
||||
|
print(tuple(namen)) |
||||
|
print(tuple('Jimbo')) |
Loading…
Reference in new issue