-
-
Save HighSoftWare96/c4244018013a3bd60d31e39df8f33450 to your computer and use it in GitHub Desktop.
null created by anonymous - https://repl.it/KaAo/19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math # learn more: https://python.org/pypi/Math | |
class Email: | |
sender = "me" | |
destination = "other" | |
def send(self): | |
print("Sent!") | |
host = "host" | |
newMail = Email() | |
print(newMail.sender) | |
print(newMail.destination) | |
print(newMail.host) | |
a = set([1, 2, 3]) | |
b = set([3, 5, 9]) | |
array = ["Primo", "Secondo", "Terzo", "Ultimo"] | |
print(a-b) | |
print(b-a) | |
print(a&b) | |
print(type(a)) | |
newMail.send() | |
print("Uso degli indici:", array[-1]) | |
print("Same: ", array[len(array) - 1]) | |
print("Intervalli: ", array[0 : 2]) #secondo parametro non compreso | |
print("Intervallo vuoto: ", array[:]) | |
array.insert(800, ["a", "a", 3]) #come elemento singolo | |
array.extend([1, 2, 3]) #come array | |
print(array) | |
print(array.count('a')) | |
print(array[array.index(["a", "a", 3])].count('a')) | |
myName = list("INNAVOIG") | |
myName.reverse() | |
# trasformazione in stringa da array | |
print("".join(myName)) | |
arrayAssoc = dict() | |
print(arrayAssoc) | |
print(arrayAssoc.get("a", -1)) | |
arrayAssoc["a"] = 22 | |
print(arrayAssoc.get("a", -1)) | |
print(arrayAssoc.get("a", -1)) | |
print(arrayAssoc.setdefault("b", -2)) | |
print(arrayAssoc["b"]) | |
print("Unusual number: ", 2 ** 10000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment