Dyskusje Q&A
Which one is true:
4 głosów
6 odpowiedziWhile true: statememts
0 głosów
2 odpowiedziIf not true: print("false")
0 głosów
1 Odpowiedźwhy python give this output ?
-3 głosów
12 odpowiedzipairs = {1: "apple",
"orange": [2, 3, 4],
True: False,
None: "True",
}
print(pairs.get("orange"))
print(pairs.get(1))
print(pairs.get(12345, "not in dictionary"))
the output is
[2, 3, 4]
False
not in dictionary
why is print(pairs.get(13345,"not in dictionary")) giving the output not in dictionary.pls I nid explanation
2 głosów
4 odpowiedziIn the continue Loop -
i = 0
while True:
i = i +1
if i == 2:
print("Skipping 2")
continue
if i == 5:
print("Breaking")
break
print(i)
print("Finished")
It shows the output being
"1
Skipping 2
3
4
Breaking
Finished"
Why are the last three lines not
"Breaking
5
Finished"
Where it shows print(i) after break?
1 Głos
3 odpowiedziPopularne dzisiaj
Sticky position
3 Votes
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes