The Secrets About python logic only a handful of people know
-
Python is a general purpose programming language that is often applied in
scripting roles.
- So, Python is programming language as well as scripting language.
- Python is also called as Interpreted language
- Python is an experiment in how much freedom programmers need.
-
Too much freedom and nobody can read another's code; too little and
expressiveness is endangered.
Python Program
#!/usr/bin/python
a = []
for i in range(10):
a.append(i * ++i)
for a[i] in a:
print(a[i])
Output
Explaination
- There's is no meaning of ++ operator in python, it's only for confusion otherwise this is done just to confuse the user
- (i * ++i) That's only equal to i square...
- The A list will store the squares from 0 to 9.
- Second for Loop ke different from first one
- Here the for loop is used as the temporary variable a[i] Loop
- Now at this point is i = 9
- a[9] is the temporary variable for this for Loop is usable..
- Printed by each value a[1]
- It will print all these but when it comes to print a[9] then 9 which has been used as a temporary variable and it holds the value of 64 which is the value of a[8] so instead of a[9] will print 64 value.
- Because
- Since a[9] will be printed, then a[9] ke will already be assigned a[8]
Disclaimer
All tutorials are for informational and educational purposes only and have been
made using our own routers, servers, websites and other vulnerable free
resources. we do not contain any illegal activity. We believe that ethical
hacking, information security and cyber security should be familiar subjects to
anyone using digital information and computers. Hacking Truth is against misuse
of the information and we strongly suggest against it. Please regard the word
hacking as ethical hacking or penetration testing every time this word is used.
We do not promote, encourage, support or excite any illegal activity or hacking.