I
I
ibr_982017-07-19 20:20:01
WiFi
ibr_98, 2017-07-19 20:20:01

How to solve this problem with the cycle?

Hello!
Let's say there is a code:

for i in range(5):
    print("hello")
hello
hello
hello
hello
hello

at the output it shows the word hello five times, can’t you somehow think of it, make it possible to assign these five output words to a variable, and then call this variable through print without a loop?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Alexander, 2019-02-02
@alexr64

Scan the network for free channels in the 5 GHz bands. Switch to a free channel at 5 GHz.
And wi-fi (and radio in general) is not about speed: at a certain frequency, 1 (one) piece of iron can simultaneously broadcast. If there are more pieces of iron, they broadcast in turn. This means that there are no guarantees either in speed or in response time. Note that at the frequency , i.e. still about any access points and their clients of the speech is not present. This means that the more pieces of iron hear each other and broadcast on the same frequency, the less time is left for each piece of iron to broadcast.
In the 2.4GHz band, there are only 3 (three) frequencies that do not overlap with each other. It is possible to squeeze the maximum out of 2.4 GHz only on the condition that there are only 2 (two) pieces of iron in the reception area and these pieces of iron can use the entire bandwidth2.4 GHz band.

S
Sergey, 2019-02-02
@edinorog

“copper wire” - Wi-Fi protocol. Haven't figured it out yet.)

Q
qlkvg, 2017-07-19
@qlkvg

result = ""
for i in range(5):
    result += "hello\r\n"
print(result)

A
Alexander Titov, 2017-07-19
@alex-t

h5 = "\n".join('hello' for i in range(5)) 
print(h5)

X
xdgadd, 2017-07-20
@xdgadd

Most likely this is a hammer bug and you actually need the function. For example:

def printer(msg="hello", times=5):
    for i in range(times):
        print(msg)
    # или любая другая реализация

printer()
printer("example", 10)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question