Question:A simple poem consists of one or more four-line verses. Each line consists of one or more words consisting of upper or lower case letters, or a combination of both upper and lower case letters. Adjacent words on a line are separated by a single...
Posted at 02:07h
in
Uncategorized
by admin
Question:
Create an FluidConversion object to convert any number of fluid units to the equivalent number of gallons, quarts, pints, and gills. (There are 128 fluid ounces in a gallon. There are 32 fluid ounces in a quart. There are 16 fluid ounces in a pint....
Posted at 13:49h
in
Uncategorized
by admin
Question:
Use input() to take 10 input from user, each item is separated by space. Then try to complete the following task:
Create a list from the input
Delete all repeated elements of the list.
Sample Input 1:
1 2 3 2 1 3 98 98 67
Sample...
Posted at 03:10h
in
Uncategorized
by admin
Question 1:
Ask the user for two numbers and then print the addition, subtraction, division(quotient), multiplication and the remainder(the number left when the first number is divided by the second number)
Sample Execution in shell
-------------------------------------------------
>>> Enter first number: 20
>>> Enter second number: 8
>>> Addition is 28
>>> Subtraction...
Question:
Write code to find the nth smallest number in the array using the
algorithm we learnt for quick sort.
Input
7,8,9,12,15,19,2,1 (Array)
3 (N)
Output
7
Explanation:
7 is the 3rd smallest number in the array...
Posted at 22:57h
in
Uncategorized
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 of 0, y...