Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81350 / parser / colapser / input.file
diff options
context:
space:
mode:
Commitb98a9799f15c8ad0275175a1d8d013c4f6e0176f (patch)
Author
 Ralitsa Dardjonova <dardzhonov@uni-sofia.bg>
2018-11-28 12:15:14 +0200
Committer
 dtrendafilov <trendafilov.dn@gmail.com>
2018-11-28 12:15:14 +0200
Filesd60c012699647adbcd20065703b0e58abb236fed /homework/81350/parser/colapser/input.file
IPL-b98a9799f15c8ad0275175a1d8d013c4f6e0176f.tar
IPL-b98a9799f15c8ad0275175a1d8d013c4f6e0176f.tar.gz
IPL-b98a9799f15c8ad0275175a1d8d013c4f6e0176f.zip
Parent3e5cf5941db07bcd3527a73b62077d5277d57f2d (diff)
Python parser and collapsing blocks + brainfuck interpreter (#46)
* Initial commit * Fix some typos modified: README * Delete index.html * Simple parser * add grammar for Python * Delete lex.backup * Delete 2 * Delete a * Delete pretty_print.cpp * Delete try1.lex * Add colapser * Delete 2 * Delete a * Delete lex.backup * Delete try1.lex * Delete pretty_print.cpp * Delete pretty_print.c * Add colapser * Fix grammar test _more cases * add README * Delete parser.tab.c * Delete parser.tab.h * Delete lex.yy.c * Delete parser * Update README * delete parser.output parser.output was generated project file * Delete output.file * Delete output.html * Delete output.html * Delete parser.output * Add brainfuck interpreter * Add README and Makefile
1 files changed, 13 insertions, 0 deletions
-rw-r--r--homework/81350/parser/colapser/input.file13
diff --git a/homework/81350/parser/colapser/input.file b/homework/81350/parser/colapser/input.file
new file mode 100644
index 0000000..223392d
--- /dev/null
+++ b/homework/81350/parser/colapser/input.file
@@ -0,0 +1,13 @@
+def func():
+ num = 7
+
+ factorial = 1
+
+ if num < 0:
+ print("Sorry, factorial does not exist for negative numbers")
+ elif num == 0:
+ print("The factorial of 0 is 1")
+ else:
+ for i in range(1,num + 1):
+ factorial = factorial*i
+ print("The factorial of",num,"is",factorial)