Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>AWS Technical Essentials v4.1</title>
<meta http-equiv="refresh" content="10,URL=/rds.php" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
import math
class Pizza:
"""
-------------------------------------------------
| method
-------------------------------------------------
| self is reference on instance
| must attacth the self in first parameters
import math
class Pizza:
"""
-------------------------------------------------
| method
-------------------------------------------------
| self is reference on instance
| must attacth the self in first parameters
class Pizza:
"""
-------------------------------------------------
| method
-------------------------------------------------
| self is reference on instance
| must attacth the self in first parameters
"""
def __init__(self, extratopping = ""):
self.topping = "tomato sauce, chopped sausage"
# 1. inisialisasi class dengan object
myObj = myClass()
myObj.myMethod()
# 2 inisialisasi class tanpa object
myClass().myMethod()
# 3. membuat objek tanpa instance
myObj = myClass
myObj.myMethod
class Pizza:
"""
-------------------------------------------------
| method
-------------------------------------------------
| self is reference on instance
| must attacth the self in first parameters
"""
def __init__(self, extratopping = ""):
self.topping = "tomato sauce, chopped sausage"