indlan 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- indlan/__init__.py +21 -0
- indlan/ast_nodes.py +181 -0
- indlan/cli.py +92 -0
- indlan/examples/examples_hindi.ind +70 -0
- indlan/examples/examples_ifelse.ind +24 -0
- indlan/examples/examples_new_features.ind +97 -0
- indlan/examples/hindi_input_demo.ind +26 -0
- indlan/examples/myprogram.ind +3 -0
- indlan/ide.py +901 -0
- indlan/ind_parser.py +409 -0
- indlan/indlan_icon.ico +0 -0
- indlan/indlan_icon.png +0 -0
- indlan/indlan_logo.png +0 -0
- indlan/interpreter.py +848 -0
- indlan/lexer.py +236 -0
- indlan-0.1.0.dist-info/METADATA +79 -0
- indlan-0.1.0.dist-info/RECORD +21 -0
- indlan-0.1.0.dist-info/WHEEL +5 -0
- indlan-0.1.0.dist-info/entry_points.txt +3 -0
- indlan-0.1.0.dist-info/licenses/LICENSE +21 -0
- indlan-0.1.0.dist-info/top_level.txt +1 -0
indlan/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
IndLan - A Hindi-inspired programming language, implemented in Python.
|
|
3
|
+
|
|
4
|
+
Made by Bhavya S Solanki.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
from .lexer import tokenize, LexError
|
|
10
|
+
from .ind_parser import parse, ParseError
|
|
11
|
+
from .interpreter import Interpreter, IndLanRuntimeError
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"tokenize",
|
|
15
|
+
"LexError",
|
|
16
|
+
"parse",
|
|
17
|
+
"ParseError",
|
|
18
|
+
"Interpreter",
|
|
19
|
+
"IndLanRuntimeError",
|
|
20
|
+
"__version__",
|
|
21
|
+
]
|
indlan/ast_nodes.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
class Node:
|
|
2
|
+
pass
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# ---------- Expressions ----------
|
|
6
|
+
|
|
7
|
+
class NumberLit(Node):
|
|
8
|
+
def __init__(self, value, line):
|
|
9
|
+
self.value = value
|
|
10
|
+
self.line = line
|
|
11
|
+
|
|
12
|
+
class StringLit(Node):
|
|
13
|
+
def __init__(self, value, line):
|
|
14
|
+
self.value = value
|
|
15
|
+
self.line = line
|
|
16
|
+
|
|
17
|
+
class FStringLit(Node):
|
|
18
|
+
"""f"hello {name}" — parts is list of ("str", text) | ("expr", expr_source)"""
|
|
19
|
+
def __init__(self, parts, line):
|
|
20
|
+
self.parts = parts
|
|
21
|
+
self.line = line
|
|
22
|
+
|
|
23
|
+
class BoolLit(Node):
|
|
24
|
+
def __init__(self, value, line):
|
|
25
|
+
self.value = value
|
|
26
|
+
self.line = line
|
|
27
|
+
|
|
28
|
+
class NullLit(Node):
|
|
29
|
+
def __init__(self, line):
|
|
30
|
+
self.line = line
|
|
31
|
+
|
|
32
|
+
class ListLit(Node):
|
|
33
|
+
def __init__(self, elements, line):
|
|
34
|
+
self.elements = elements
|
|
35
|
+
self.line = line
|
|
36
|
+
|
|
37
|
+
class DictLit(Node):
|
|
38
|
+
def __init__(self, pairs, line):
|
|
39
|
+
self.pairs = pairs # list of (key_node, value_node)
|
|
40
|
+
self.line = line
|
|
41
|
+
|
|
42
|
+
class Identifier(Node):
|
|
43
|
+
def __init__(self, name, line):
|
|
44
|
+
self.name = name
|
|
45
|
+
self.line = line
|
|
46
|
+
|
|
47
|
+
class BinOp(Node):
|
|
48
|
+
def __init__(self, op, left, right, line):
|
|
49
|
+
self.op = op
|
|
50
|
+
self.left = left
|
|
51
|
+
self.right = right
|
|
52
|
+
self.line = line
|
|
53
|
+
|
|
54
|
+
class UnaryOp(Node):
|
|
55
|
+
def __init__(self, op, operand, line):
|
|
56
|
+
self.op = op
|
|
57
|
+
self.operand = operand
|
|
58
|
+
self.line = line
|
|
59
|
+
|
|
60
|
+
class LogicalOp(Node):
|
|
61
|
+
def __init__(self, op, left, right, line):
|
|
62
|
+
self.op = op
|
|
63
|
+
self.left = left
|
|
64
|
+
self.right = right
|
|
65
|
+
self.line = line
|
|
66
|
+
|
|
67
|
+
class Assign(Node):
|
|
68
|
+
def __init__(self, target, value, line, op="="):
|
|
69
|
+
self.target = target
|
|
70
|
+
self.value = value
|
|
71
|
+
self.op = op
|
|
72
|
+
self.line = line
|
|
73
|
+
|
|
74
|
+
class Call(Node):
|
|
75
|
+
def __init__(self, callee, args, line):
|
|
76
|
+
self.callee = callee
|
|
77
|
+
self.args = args
|
|
78
|
+
self.line = line
|
|
79
|
+
|
|
80
|
+
class Index(Node):
|
|
81
|
+
def __init__(self, obj, index, line):
|
|
82
|
+
self.obj = obj
|
|
83
|
+
self.index = index
|
|
84
|
+
self.line = line
|
|
85
|
+
|
|
86
|
+
class GetAttr(Node):
|
|
87
|
+
def __init__(self, obj, name, line):
|
|
88
|
+
self.obj = obj
|
|
89
|
+
self.name = name
|
|
90
|
+
self.line = line
|
|
91
|
+
|
|
92
|
+
class FunctionExpr(Node):
|
|
93
|
+
"""Anonymous function (used internally for fun declarations too)."""
|
|
94
|
+
def __init__(self, params, body, line, name=None):
|
|
95
|
+
self.params = params
|
|
96
|
+
self.body = body
|
|
97
|
+
self.line = line
|
|
98
|
+
self.name = name
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# ---------- Statements ----------
|
|
102
|
+
|
|
103
|
+
class LetStmt(Node):
|
|
104
|
+
def __init__(self, name, value, line):
|
|
105
|
+
self.name = name
|
|
106
|
+
self.value = value
|
|
107
|
+
self.line = line
|
|
108
|
+
|
|
109
|
+
class ExprStmt(Node):
|
|
110
|
+
def __init__(self, expr, line):
|
|
111
|
+
self.expr = expr
|
|
112
|
+
self.line = line
|
|
113
|
+
|
|
114
|
+
class Block(Node):
|
|
115
|
+
def __init__(self, statements, line):
|
|
116
|
+
self.statements = statements
|
|
117
|
+
self.line = line
|
|
118
|
+
|
|
119
|
+
class IfStmt(Node):
|
|
120
|
+
def __init__(self, branches, else_block, line):
|
|
121
|
+
# branches: list of (condition, block)
|
|
122
|
+
self.branches = branches
|
|
123
|
+
self.else_block = else_block
|
|
124
|
+
self.line = line
|
|
125
|
+
|
|
126
|
+
class WhileStmt(Node):
|
|
127
|
+
def __init__(self, condition, body, line):
|
|
128
|
+
self.condition = condition
|
|
129
|
+
self.body = body
|
|
130
|
+
self.line = line
|
|
131
|
+
|
|
132
|
+
class DoWhileStmt(Node):
|
|
133
|
+
def __init__(self, body, condition, line):
|
|
134
|
+
self.body = body
|
|
135
|
+
self.condition = condition
|
|
136
|
+
self.line = line
|
|
137
|
+
|
|
138
|
+
class SwitchStmt(Node):
|
|
139
|
+
def __init__(self, subject, cases, default_block, line):
|
|
140
|
+
# cases: list of (value_expr, block)
|
|
141
|
+
self.subject = subject
|
|
142
|
+
self.cases = cases
|
|
143
|
+
self.default_block = default_block
|
|
144
|
+
self.line = line
|
|
145
|
+
|
|
146
|
+
class ForStmt(Node):
|
|
147
|
+
def __init__(self, var_name, iterable, body, line):
|
|
148
|
+
self.var_name = var_name
|
|
149
|
+
self.iterable = iterable
|
|
150
|
+
self.body = body
|
|
151
|
+
self.line = line
|
|
152
|
+
|
|
153
|
+
class FunDecl(Node):
|
|
154
|
+
def __init__(self, name, params, body, line):
|
|
155
|
+
self.name = name
|
|
156
|
+
self.params = params
|
|
157
|
+
self.body = body
|
|
158
|
+
self.line = line
|
|
159
|
+
|
|
160
|
+
class ReturnStmt(Node):
|
|
161
|
+
def __init__(self, value, line):
|
|
162
|
+
self.value = value
|
|
163
|
+
self.line = line
|
|
164
|
+
|
|
165
|
+
class BreakStmt(Node):
|
|
166
|
+
def __init__(self, line):
|
|
167
|
+
self.line = line
|
|
168
|
+
|
|
169
|
+
class ContinueStmt(Node):
|
|
170
|
+
def __init__(self, line):
|
|
171
|
+
self.line = line
|
|
172
|
+
|
|
173
|
+
class ClassDecl(Node):
|
|
174
|
+
def __init__(self, name, methods, line):
|
|
175
|
+
self.name = name
|
|
176
|
+
self.methods = methods # list of FunDecl
|
|
177
|
+
self.line = line
|
|
178
|
+
|
|
179
|
+
class Program(Node):
|
|
180
|
+
def __init__(self, statements):
|
|
181
|
+
self.statements = statements
|
indlan/cli.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
IndLan - A programming language implemented in Python.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
indlan myprogram.ind # run a file
|
|
7
|
+
indlan # start REPL
|
|
8
|
+
indlan --version # show version
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import sys
|
|
12
|
+
import os
|
|
13
|
+
|
|
14
|
+
from . import __version__
|
|
15
|
+
from .lexer import tokenize, LexError
|
|
16
|
+
from .ind_parser import parse, ParseError
|
|
17
|
+
from .interpreter import Interpreter, IndLanRuntimeError
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def print_banner():
|
|
21
|
+
lines = [
|
|
22
|
+
"Welcome to IndLan",
|
|
23
|
+
"Made by Bhavya S Solanki",
|
|
24
|
+
]
|
|
25
|
+
width = max(len(line) for line in lines) + 4
|
|
26
|
+
top = "+" + "-" * (width - 2) + "+"
|
|
27
|
+
print(top)
|
|
28
|
+
for line in lines:
|
|
29
|
+
padding = width - 2 - len(line)
|
|
30
|
+
left = padding // 2
|
|
31
|
+
right = padding - left
|
|
32
|
+
print("|" + " " * left + line + " " * right + "|")
|
|
33
|
+
print(top)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def run_source(source, interpreter):
|
|
37
|
+
try:
|
|
38
|
+
tokens = tokenize(source)
|
|
39
|
+
program = parse(tokens)
|
|
40
|
+
interpreter.run(program)
|
|
41
|
+
except LexError as e:
|
|
42
|
+
print(e, file=sys.stderr)
|
|
43
|
+
except ParseError as e:
|
|
44
|
+
print(e, file=sys.stderr)
|
|
45
|
+
except IndLanRuntimeError as e:
|
|
46
|
+
print(e, file=sys.stderr)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def run_file(path):
|
|
50
|
+
if not os.path.exists(path):
|
|
51
|
+
print(f"IndLan: file not found: {path}", file=sys.stderr)
|
|
52
|
+
sys.exit(1)
|
|
53
|
+
print_banner()
|
|
54
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
55
|
+
source = f.read()
|
|
56
|
+
interpreter = Interpreter()
|
|
57
|
+
run_source(source, interpreter)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def repl():
|
|
61
|
+
print_banner()
|
|
62
|
+
print("IndLan REPL (type 'exit' to quit)")
|
|
63
|
+
interpreter = Interpreter()
|
|
64
|
+
while True:
|
|
65
|
+
try:
|
|
66
|
+
line = input("indlan> ")
|
|
67
|
+
except (EOFError, KeyboardInterrupt):
|
|
68
|
+
print()
|
|
69
|
+
break
|
|
70
|
+
if line.strip() in ("exit", "quit"):
|
|
71
|
+
break
|
|
72
|
+
if not line.strip():
|
|
73
|
+
continue
|
|
74
|
+
run_source(line, interpreter)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def main():
|
|
78
|
+
args = sys.argv[1:]
|
|
79
|
+
if args and args[0] in ("-v", "--version"):
|
|
80
|
+
print(f"IndLan {__version__}")
|
|
81
|
+
return
|
|
82
|
+
if args and args[0] in ("-h", "--help"):
|
|
83
|
+
print(__doc__)
|
|
84
|
+
return
|
|
85
|
+
if args:
|
|
86
|
+
run_file(args[0])
|
|
87
|
+
else:
|
|
88
|
+
repl()
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
main()
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// IndLan Hindi keyword test - agar/nahito, jabtak, pratyek, karo-jabtak, vibhag
|
|
2
|
+
|
|
3
|
+
maano umar = 20
|
|
4
|
+
|
|
5
|
+
agar umar < 13 {
|
|
6
|
+
chhap("Bachha ho")
|
|
7
|
+
} nahito_agar umar < 20 {
|
|
8
|
+
chhap("Teenager ho")
|
|
9
|
+
} nahito {
|
|
10
|
+
chhap("Adult ho")
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
chhap("== jabtak loop ==")
|
|
14
|
+
maano i = 0
|
|
15
|
+
jabtak i < 5 {
|
|
16
|
+
chhap("i =", i)
|
|
17
|
+
i += 1
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
chhap("== pratyek loop ==")
|
|
21
|
+
pratyek n mein range(5) {
|
|
22
|
+
agar n == 3 {
|
|
23
|
+
jaari
|
|
24
|
+
}
|
|
25
|
+
chhap("n =", n)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
chhap("== karo-jabtak (do-while) ==")
|
|
29
|
+
maano j = 0
|
|
30
|
+
karo {
|
|
31
|
+
chhap("j =", j)
|
|
32
|
+
j += 1
|
|
33
|
+
} jabtak j < 3
|
|
34
|
+
|
|
35
|
+
chhap("== vibhag (switch) ==")
|
|
36
|
+
maano din = 3
|
|
37
|
+
vibhag din {
|
|
38
|
+
sthiti 1 {
|
|
39
|
+
chhap("Somvaar")
|
|
40
|
+
}
|
|
41
|
+
sthiti 2 {
|
|
42
|
+
chhap("Mangalvaar")
|
|
43
|
+
}
|
|
44
|
+
sthiti 3 {
|
|
45
|
+
chhap("Budhvaar")
|
|
46
|
+
}
|
|
47
|
+
anyatha {
|
|
48
|
+
chhap("Pata nahi")
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
chhap("== function aur class ==")
|
|
53
|
+
kaam jodo(a, b) {
|
|
54
|
+
vapas a + b
|
|
55
|
+
}
|
|
56
|
+
chhap("jodo(4, 5) =", jodo(4, 5))
|
|
57
|
+
|
|
58
|
+
varg Animal {
|
|
59
|
+
kaam init(naam, awaaz) {
|
|
60
|
+
yeh.naam = naam
|
|
61
|
+
yeh.awaaz = awaaz
|
|
62
|
+
}
|
|
63
|
+
kaam bolo() {
|
|
64
|
+
chhap(yeh.naam, "bolta hai", yeh.awaaz)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
maano kutta = naya Animal("Kutta", "Bhow")
|
|
68
|
+
kutta.bolo()
|
|
69
|
+
|
|
70
|
+
chhap("Sab kaam ho gaya!")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// if / elif / else example in IndLan
|
|
2
|
+
|
|
3
|
+
let age = 20
|
|
4
|
+
|
|
5
|
+
if age < 13 {
|
|
6
|
+
print("You are a child")
|
|
7
|
+
} elif age < 20 {
|
|
8
|
+
print("You are a teenager")
|
|
9
|
+
} else {
|
|
10
|
+
print("You are an adult")
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// another example with score grading
|
|
14
|
+
let score = 75
|
|
15
|
+
|
|
16
|
+
if score >= 90 {
|
|
17
|
+
print("Grade: A")
|
|
18
|
+
} elif score >= 75 {
|
|
19
|
+
print("Grade: B")
|
|
20
|
+
} elif score >= 50 {
|
|
21
|
+
print("Grade: C")
|
|
22
|
+
} else {
|
|
23
|
+
print("Grade: F")
|
|
24
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// IndLan - New Features Showcase
|
|
2
|
+
// ================================
|
|
3
|
+
|
|
4
|
+
// 1. Exponentiation (**)
|
|
5
|
+
print("== Exponentiation ==")
|
|
6
|
+
let base = 2
|
|
7
|
+
let power = 10
|
|
8
|
+
print(f"{base} ** {power} = {base ** power}")
|
|
9
|
+
print("3 ** 3 =", 3 ** 3)
|
|
10
|
+
|
|
11
|
+
// 2. F-strings
|
|
12
|
+
print("\n== F-strings ==")
|
|
13
|
+
let name = "Bhavya"
|
|
14
|
+
let age = 17
|
|
15
|
+
print(f"Hello {name}, you are {age} years old!")
|
|
16
|
+
print(f"Next year you will be {age + 1}.")
|
|
17
|
+
maano dost = "Rahul"
|
|
18
|
+
chhap(f"Namaste {dost}! Kya haal hai?")
|
|
19
|
+
|
|
20
|
+
// 3. input_int / input_float / input_bool / char
|
|
21
|
+
// (uncomment to test interactively)
|
|
22
|
+
// let n = input_int("Enter a number: ")
|
|
23
|
+
// print(f"You entered: {n}, doubled: {n * 2}")
|
|
24
|
+
// let b = input_bool("Are you happy? (true/false): ")
|
|
25
|
+
// print(f"Happy: {b}")
|
|
26
|
+
|
|
27
|
+
// 4. bool() and char()
|
|
28
|
+
print("\n== bool() and char() ==")
|
|
29
|
+
print("bool(0) =", bool(0))
|
|
30
|
+
print("bool(42) =", bool(42))
|
|
31
|
+
print("bool(\"\") =", bool(""))
|
|
32
|
+
print("bool(\"hi\") =", bool("hi"))
|
|
33
|
+
print("char(65) =", char(65))
|
|
34
|
+
print("char(97) =", char(97))
|
|
35
|
+
print("char('Z') =", char("Z"))
|
|
36
|
+
|
|
37
|
+
// 5. Math builtins
|
|
38
|
+
print("\n== Math ==")
|
|
39
|
+
print("abs(-42) =", abs(-42))
|
|
40
|
+
print("sqrt(144) =", sqrt(144))
|
|
41
|
+
print("floor(3.9) =", floor(3.9))
|
|
42
|
+
print("ceil(3.1) =", ceil(3.1))
|
|
43
|
+
print("round(3.567, 2) =", round(3.567, 2))
|
|
44
|
+
print("max(1, 9, 3) =", max(1, 9, 3))
|
|
45
|
+
print("min([5, 2, 8]) =", min([5, 2, 8]))
|
|
46
|
+
|
|
47
|
+
// 6. String methods
|
|
48
|
+
print("\n== String Methods ==")
|
|
49
|
+
let s = " Hello, IndLan World! "
|
|
50
|
+
print(s.strip())
|
|
51
|
+
print(s.strip().lower())
|
|
52
|
+
print(s.strip().upper())
|
|
53
|
+
print(s.strip().replace("World", "India"))
|
|
54
|
+
print(s.strip().startswith("Hello"))
|
|
55
|
+
print(s.strip().endswith("!"))
|
|
56
|
+
let words = "apple,banana,cherry"
|
|
57
|
+
let parts = words.split(",")
|
|
58
|
+
print("split:", parts)
|
|
59
|
+
print("find 'banana':", words.find("banana"))
|
|
60
|
+
|
|
61
|
+
// 7. List methods
|
|
62
|
+
print("\n== List Methods ==")
|
|
63
|
+
let nums = [5, 3, 8, 1, 4]
|
|
64
|
+
sort(nums)
|
|
65
|
+
print("sorted:", nums)
|
|
66
|
+
reverse(nums)
|
|
67
|
+
print("reversed:", nums)
|
|
68
|
+
insert(nums, 0, 100)
|
|
69
|
+
print("after insert(0, 100):", nums)
|
|
70
|
+
remove(nums, 100)
|
|
71
|
+
print("after remove(100):", nums)
|
|
72
|
+
print("has(nums, 8):", has(nums, 8))
|
|
73
|
+
print("has(nums, 99):", has(nums, 99))
|
|
74
|
+
|
|
75
|
+
// 8. String repetition and negative index
|
|
76
|
+
print("\n== String repeat & negative index ==")
|
|
77
|
+
print("ha" * 4)
|
|
78
|
+
let arr = [10, 20, 30, 40, 50]
|
|
79
|
+
print("arr[-1] =", arr[-1])
|
|
80
|
+
print("arr[-2] =", arr[-2])
|
|
81
|
+
|
|
82
|
+
// 9. type()
|
|
83
|
+
print("\n== type() ==")
|
|
84
|
+
print(type(42))
|
|
85
|
+
print(type(3.14))
|
|
86
|
+
print(type("hello"))
|
|
87
|
+
print(type(true))
|
|
88
|
+
print(type([1, 2]))
|
|
89
|
+
print(type({"a": 1}))
|
|
90
|
+
print(type(null))
|
|
91
|
+
|
|
92
|
+
// 10. has() on dict and string
|
|
93
|
+
print("\n== has() on dicts and strings ==")
|
|
94
|
+
let d = {"x": 1, "y": 2}
|
|
95
|
+
print("has(d, 'x'):", has(d, "x"))
|
|
96
|
+
print("has(d, 'z'):", has(d, "z"))
|
|
97
|
+
print("has('IndLan', 'Lan'):", has("IndLan", "Lan"))
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Hindi Input Demo - उपयोगकर्ता इनपुट
|
|
2
|
+
|
|
3
|
+
maano naam = aalao("Aapka naam kya hai? ")
|
|
4
|
+
maano umar = number_dalao("Aapki umar kitni hai? ")
|
|
5
|
+
maano score = decimal_dalao("Aapka score kya hai? ")
|
|
6
|
+
maano khush = haan_na("Kya aap khush hain? (true/false): ")
|
|
7
|
+
|
|
8
|
+
chhap(f"Namaste {naam}!")
|
|
9
|
+
chhap(f"Aap {umar} saal ke hain.")
|
|
10
|
+
chhap(f"Aapka score: {score}")
|
|
11
|
+
|
|
12
|
+
agar khush {
|
|
13
|
+
chhap("Bahut achha! Khush rehna :)")
|
|
14
|
+
} nahito {
|
|
15
|
+
chhap("Chinta mat karo, sab theek hoga!")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
agar umar < 13 {
|
|
19
|
+
chhap("Aap bachhe hain.")
|
|
20
|
+
} nahito_agar umar < 20 {
|
|
21
|
+
chhap("Aap teenager hain.")
|
|
22
|
+
} nahito_agar umar < 60 {
|
|
23
|
+
chhap("Aap adult hain.")
|
|
24
|
+
} nahito {
|
|
25
|
+
chhap("Aap buzurg hain, pranaam!")
|
|
26
|
+
}
|