Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
The questions are being asked but the if statements do not show up. What mistake am I making?
print() is a built-in function, if you want to call the function to print out text in the console, you have to use it like this:
print(arguments)
This
print = (arguments)
is not calling print(), but is assigning something to the name "print".
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 11 months ago.
Improve this question
Why is it necessary to use and and vice versa in the while loop where or is appropriate in meaning?
'and' is working only when every condition is satisfied
while 'or' is working when even one of conditions is true
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I found this code somewhere in Google.i don't understand how the output is displayed in this sequence.can anyone explain me this?
Code:
def main():
make_omelet()
print("ocean")
def make_omelet():
print("hello")
break_eggs()
print("sos")
def break_eggs():
print("sea")
main()
Output:
hello
sea
sos
ocean
here is the flow that generates the output
main --> make_omelet --> break_eggs
Follow the logic and see how the output is generated,
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to create this for loop, but the text in the loop is quoted.
How can this be done please?
Thank you!
https://prnt.sc/tvutcl
in your image is in quotes, is an f-string, but they forgot to add the f
year = [2016,2017,2018,2019,2020]
for i in year:
rtx_price = (data.loc[f'{year}-07-31', 'RTX'])
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
how can we write this single statement code into multiple lines?
I can understand only for loop written in multiple lines. Anyone, please break this code into multiple line code.
amp.append([amp[i] for i in ida])
By a for loop:
l = []
for i in ida:
l.append(amp[i])
amp.append(l)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
This is a simple question:
In Python, if a function does not contain a return statement, does it automatically return None?
Yes. From the Python tutorial:
In fact, even functions without a return statement do return a value, albeit a rather boring one. This value is called None (it’s a built-in name).