This file contains hidden or 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
# CS 1.1 - Code Quality, Reuse, & Error Handling code snippets | |
def foo(x): | |
y = 0 | |
for z in x: | |
if z == 'e': | |
y = y +1 | |
if y == 2: | |
return True | |
else: |
This file contains hidden or 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
# CS-1.1 Variables, Function, and Program Design | |
def addTen(x): | |
plusTen = x + 10 | |
return plusTen | |
print(addTen(4)) | |
# 14 | |
print(addTen(10)) |
This file contains hidden or 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
print("hello world") |