Question:Modify the Die class we made in the last class blow, so it can complete the following tasks:
You could compare with different dies using > and <. In order to complete this task, you need to overwrite __gt__ and __lt__ methods.
You could use print() to...
Posted at 01:21h
in
Uncategorized
by admin
Question:
Use TKinter to create 6 buttons as following picture:
...
Question:
Rory is playing with an array A consisting of N integer elements indexed from 1 to N and a positive integer M. Rory will perform Q operations. Each operation is either type 1 or type 2.
Type 1 operation is in the form 1 l r...
Question:
Continue with the code of the previous class and create a method to add data to a heap....
Posted at 21:52h
in
Uncategorized
by admin
Draw the following picture in the pygame window: (could be different color)
Hint: using pygame.draw.circle
...
Question:
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.
Sample Input 1:
Apple
Sample Output 1:
0
Explanation:
“a” is the first character which is not repeating in the string apple and occur only once.
Sample Input 2:
lovelivesure
Sample Output 2:
1
Explanation:...