Skip to content

print() is a function in Python 3 #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions data_structures/Stacks/Stock-Span-Problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
number of consecutive days just before the given day, for which the price of the stock
on the current day is less than or equal to its price on the given day.
'''
from __future__ import print_function


def calculateSpan(price, S):

n = len(price)
Expand Down Expand Up @@ -37,7 +40,7 @@ def calculateSpan(price, S):
# A utility function to print elements of array
def printArray(arr, n):
for i in range(0,n):
print arr[i],
print(arr[i], end=' ')


# Driver program to test above function
Expand All @@ -48,4 +51,4 @@ def printArray(arr, n):
calculateSpan(price, S)

# Print the calculated span values
printArray(S, len(price))
printArray(S, len(price))