Answer the question
In order to leave comments, you need to log in
How to pass a for loop to the forEach method without changing anything (or almost nothing) in the code except for the for loop itself?
I have an image slider with buttons below the images:
https://jsfiddle.net/g4roc9m8/1/
How can I replace the for loop with the forEach method in this slider without changing anything in other parts of the code (or changing at a minimum)? I found a slider with the forEach method on the Internet, but there are some remainders from division and in general the code is written too intricately for me personally...
Answer the question
In order to leave comments, you need to log in
Wrong line break at least
url = f"https://query.yahooapis.com/v1/public/yql?q="\
+ f"select%20*%20from%20weather.forecast%20where%20w" \
+ f"oeid%20in%20(select%20woeid%20from%20geo.places("\
+ f"1)%20where%20text%3D%22{city}%22)%20and%20u%3D%2" \
+ f"7c%27&format=json&env=store%3A%2F%2Fdatatables.o" \
+ f"rg%2Falltableswithkeys"
It is not necessary to explicitly specify string concatenation at all. you can do this:
url = " https://query.yahooapis.com/v1/public/yql?q= "\
"select%20*%20from%20weather.forecast%20where%20w" \
"oeid%20in%20 (select%20woeid%20from%20geo.places("\
f"1)%20where%20text%3D%22{city}%22)%20and%20u%3D%2" \
"7c%27&format=json&env=store% 3A%2F%2Fdatatables.o" \
"rg%2Falltableswithkeys"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question