127.0.0.1 is the loopback Internet Protocol (IP), the address is used to establish an IP connection to the same computer being used by the end-user.
The some reason that a person will command a ping 127.0.0.1 in a command prompt is because they will check if the NIC and drivers implementation is functional and it used in testing the TCP/IP.
Answer:
- num1=10
- num2 =20
- num3="30"
- sum = num1+num2+num3
- print (num1)
- print (num2)
- print (num3)
- print (sum)
The error is at line 3. The variable num3 has been assigned a string value with use of the quotes.
To fix the error, take away the quotes from the number 30, since the arithemetic operation cannot be carried out on the string in python program language.
Explanation:
A i believe is the answer
<span>'m pretty sure the big O is actually O(log n)
Not really a proof but anyway.
If you write out the values before each iteration of the loop you get.
L - iteration number
L i t
1 1 0
2 1 2
3 3 6
4 9 18
5 27 54
6 81 162
So if n was 80 it would take 6 iterations
You can see i is growing like 3^(L-2)
So if n was 1000
1000 = 3^(L-2)
log(1000) [base 3] = L - 2
log(1000) [base 3] + 2 = L
8.287709822868152 = L
and if you ceil the answer you get L = 9
and just to check with the table
6 81 162
7 243 486
8 729 1458
9 2187 ...
The table isn't perfect but hopefully you get the main idea.</span>