Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Part-1-Functions
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
# arrayCheck([1, 1, 2, 1, 2, 3]) → True

def arrayCheck(nums):
# CODE GOES HERE
num=[1,3,5,7]
for i in num:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Program is wrong please recheck the error
Don't use num the function already has a parameter nums
and Don't use num for For Loop.
There is a index out of bound error if you run this code.

if(num[i]==1 and num[i+1]==2 and num[i+2]==3):
print("True")
else:
print("False")



#####################
Expand All @@ -38,7 +44,11 @@ def arrayCheck(nums):
# stringBits('Heeololeo') → 'Hello'

def stringBits(str):
# CODE GOES HERE
l=len(str)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you take L?

print(str)
print(str(0:l:2))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong slicing syntax





#####################
Expand Down