Posted at 18:50h
in
Uncategorized
by admin
You can do Question 1~ 3 in Python IDLE:
Question 1.
Use float() to create a number from a string like ‘12.34’. Make sure the result is really a number!
Question 2.
Try using int() to create an integer from a decimal number like 56.78. Did the answer get rounded up...
Posted at 15:46h
in
Uncategorized
by admin
Question:
Continue to program the code we made in the class at the bottom of this page. Try to use for loop to create buttons from 1-9, so the tkinter window would display as below:
Hint:You can use "for i in range(1, 10):" or "for i in...
Solution 2 sample coding at the bottom of the page
Question:When moving, ants form rows so that each ant except the first is behind another ant. It is not widely known what happens when two rows of ants moving in opposite directions run into each other...
Question:
Given two values n1 and n2, write code to find the lowest common ancestor of number n1 and n2.
Sample Input 1:
10
14
Sample Output 1:
12
Explanation:
Both 10 and 14 the children of 12
Sample Input 2:
8
14
Sample Output 2:
8
Explanation:
8 is the closest node to both 8 and 14...
Posted at 01:08h
in
Uncategorized
by admin
Continue with the code in the previous class and change the code such that the circle moves in both x direction and y direction.
...
Question:
When moving, ants form rows so that each ant except the first is behind another ant. It is not widely known what happens when two rows of ants moving in opposite directions run into each other in a passage too narrow for both rows to...