Please enable JavaScript.
Coggle requires JavaScript to display documents.
DAT555, . ((print(), sum(), round(), max()/min(), int()/float(), type (),…
DAT555
for i in ...
...
-
for i in range(...), här ... MÅSTE vara ett tal
-
definera variable
words \= ["hello", "cat", "python"] count \= 0 # nollställs för varje ord for char in w: if char in "aeiou": count += 1
while:
som loop
-
condition, ex. true, <5 etc.
-
-
.
-
sum()
INTE
strängar, "listor", "dictionaries."
-
-
-
-
-
-
len()
BARA (str, list, tuple, dict).
-
-
-
method vs funktion
funktion
-
-
ändrar inte objektet, MEN returnerar ett nytt värde
methoder
-
-
kan ändra objektet (mutera), möjligtvis none problem --> ny lista som du ändrar istället
-