Posted at 19:16h
in
Uncategorized
by admin
Question:
Create the following * pattern image base on your input
Sample Input 1:
3
Sample Output 1:
***
**
*
*
**
***
Sample Input 2:
5
Sample Output 2:
*****
****
***
**
*
*
**
***
****
*****
Sample Input 3:
1
Sample Output 3:
*
*
Sample Input 4:
2
Sample Output 4:
**
*
*
**...
Posted at 19:13h
in
Uncategorized
by admin
Problem Description
A common problem in mathematics is to determine which quadrant a given point lies in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below:
For example, the point A, which is at coordinates (12, 5) lies in quadrant 1...
Question:
Create the following * pattern image base on your input
Sample Input 1:
3
Sample Output 1:
***
**
*
*
**
***
Sample Input 2:
5
Sample Output 2:
*****
****
***
**
*
*
**
***
****
*****
Sample Input 3:
1
Sample Output 3:
*
*
Sample Input 4:
2
Sample Output 4:
**
*
*
**...
Posted at 02:07h
in
Uncategorized
by admin
Question:
Make a list by taking 10 input from user. Now delete all repeated elements of the list.
Sample Input:
1,2,3,2,1,3,12,12,32
Sample Output:
1,2,3,12,32
...
Posted at 17:23h
in
Uncategorized
by admin
Question:
Make a program to verify whether the credit card numbers from ABCD Bank are valid or not.A valid credit card from ABCD Bank has the following characteristics:
It must start with a 4, 5 or 6.
It must contain exactly 16 digits.
It must only consist of digits (0-9).
It...
Posted at 17:16h
in
archives
by admin
Question:
Create a Tank class which have the attributes of:
name
direction(use 'up', 'down', 'left' or 'right')
x position and
y position
The class also have the following method:
move (self, direction, steps)
Using __init__() to Initial the tank to make sure it start from x position...