Author: admin
Home > Articles posted by admin (Page 148)
Posted at 02:43h
in
Uncategorized
by admin
Question 1:
Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this:
You probably used a for loop in your program in last homework. That’s how most people would do...
Posted at 02:41h
in
Uncategorized
by admin
Problem DescriptionSuppose we have a number like 12. Let’s define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200....
Posted at 02:39h
in
Uncategorized
by admin
Question:
Create Card class so it can complete the following tasks:
You can initial the card with value.
you can compare two card object like c1>c2.
you can use print(c1) shows the card value
(Assume the smallest card value is 2, then followed by 3, 4, 5,...
Question:
A spiral of numbers can start and end with any positive integers less than 100. Write a program which will accept two positive integers x and y as input, and output a list of numbers from xx to y inclusive, shown in a spiral. You may assume that...
Posted at 13:51h
in
archives
by admin
Problem Description
We have learn how to use stack to solve some problems and how to convert decimal number into binary number:
Please write the program to convert a given decimal number into a binary number by using the following steps for python coding solutions:
takes an...
Posted at 13:35h
in
Uncategorized
by admin
The following questions could be done in the IDLE window
Question 1
Make a variable and assign a number to it (any number you like). Then display your variable using print.
Question 2
Modify your variable, either by replacing the old value with a new value, or by adding something to the...
Posted at 01:58h
in
Uncategorized
by admin
Question 1.
Use EasyGui to write a program to convert temperatures from Fahrenheit to Celsius. The formula for that is:
Celsius = 5 / 9 * (Fahrenheit - 32).
Use GUI input and output. You need to create a easygui enterbox to ask Fahrenheit, then use message box...
Posted at 01:50h
in
Uncategorized
by admin
Question 1.
Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this:
Sample Input:
Which multiplication table would you like? 5
Sample Output:
Here’s your table:
5 x 1 = 5
5 x 2...
Posted at 21:05h
in
Uncategorized
by admin
Question 1:
Please using easygui to create the program we made in the class. The enter box will ask you password, if you get the right password, the msgbox will display 'FBI Access granted'
Question 2:
Create a simple number guessing game. The computer will ask the first...
Posted at 20:43h
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...