-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpython course.py
More file actions
93 lines (59 loc) · 1.22 KB
/
python course.py
File metadata and controls
93 lines (59 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 1 20:15:40 2019
@author: Arslanth
"""
"""
print("hello world!")
inputs= "hahaha"
type(inputs)
input("aras")
"""
name = "yeet"
"""if else"""
if(name=="yeet"):
print("this is if")
elif(name=="tiara"):
print("this is elif")
else:
print("this is else")
"""for"""
x = 0
for x in range(0,5):
print("x")
"""while"""
i=0
while(i<5):
print("i")
i+=1
""" nyoba fungsi """
def test_function_return_value(input_value):
return input_value * 2
print(test_function_return_value(input_value = 5))
"""manipulate variabel"""
global_var = 10
def test_namespace():
private_var = 5
global_var = 6
print("private_val", private_var)
print("global_val", global_var)
test_namespace()
print("global val", global_var)
"""String operator"""
String1 = "nama "
String2 = "Aras Maulana"
String3 = "are you lis ten ing"
"""concat"""
print(String1 + String2)
"""slicing"""
print(String2[3:6])
"""lower"""
print(String2.lower())
"""upper"""
print(String2.upper())
"""Length atau len"""
print(len(String2))
"""Strip"""
print(String2.strip("A"))
"""split"""
print(String3.split(" "))