+ 1
What is with() in python
10 Answers
+ 2
Not sure I fully understand the question, but here goes.
() is typically placed after a function to enable the function to act upon the data within the ().
Example: x = input() will prompt the user to enter information which may be displayed by print(x)
Another example
def code_function():
write your code here:
create a function result
Print(code_function(data))
The () contain the data you wish the function to act on.
Sololearn modules cover this in detail. Take your time with it
+ 3
SUNDARAMAN IYER
I think we may be looking at a little language barrier here.
Has swim answered your question with his post?
If not, can you phrase your question differently?
Are you trying to understand the use of functions within Python, or how () associates with functions, or something else?
Don't give up, cause we won't. đ
+ 1
I agree with you ,
My question was what is with function use in python
+ 1
+1 I too would like to understand your question and help out :)
+ 1
apparantly it is some sort of try finally block replacement
0
Actually I was working with project and a syntax
filename = input("Enter a filename: ")
with open(filename) as f:
text = f.read()
print(count_char(text, "r"))
0
So can anyone figure it out