Posted at 02:24h
in
Uncategorized
by admin
Question:
You have come up with the following compression technique: for each symbol, write down the number of times it appears consecutively, followed by the symbol itself. This compression technique is called run-length encoding.
Given a sequence of characters, write a program to encode them in this...
Posted at 02:16h
in
Uncategorized
by admin
Question:
write a function to convert temperatures from Fahrenheit to Celsius. The formula for that is: Celsius = 5 / 9 * (Fahrenheit – 32).
Class review:
Class review:
...
Posted at 02:12h
in
Uncategorized
by admin
Question:
Write a function to print your name in big letters, make sure you enter the name in lower case, like this:
Please click and download the following file and finish the function.
big_letter_hint
...
Question:
Input a string using a scanner and output a "cleaned" string where adjacent characters that are the same have been reduced to a single char.
Use recursion
Sample Input 1:
Yyzzza
Sample Output 1:
Yza
Sample Input 2:
Apple
Sample Output 2:
aple...
Posted at 01:26h
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 01:15h
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...