Prerequisites:
- Variables
- Simple data types
- String methods: lower, upper, etc.
Assignment:
- Assign a message to a variable, and then print that message.
- Assign a message to a variable, and print that message. Then change the value of the variable to a new message, and print the new message.
- Use a variable to represent a person’s name, and then print that person’s name in lowercase, uppercase, and title case
- Print list of your favourite foods with tab indentation.
My favorite food:
Khinkali
Burger
Pizza- Remove whitespaces from folowing string:
' I have white spaces '- Remove only left white spaces in string from 8th Exercise
- Remove only right white spaces in string from 8th Exercise
- Create string with single quotes (') and include at least one additional single quote in it.
# EXAMPLE
'One of Python's strengths is its diverse community.'
- Use a variable to represent a person’s name, and print a message to that person. Your message should be simple, such as, “Hello Eric, would you like to learn some Python today?”
- Find a quote from a famous person you admire. Print the quote and the name of its author. Your output should look something like the following, including the quotation marks:
Albert Einstein once said, “A person who never made a
mistake never tried anything new.”
- Repeat Exercise 13, but this time, represent the famous person’s name using a variable called famous_person. Then compose your message and represent it with a new variable called message. Print your message
- Write addition, subtraction, multiplication, and division operations that each result in the number 8. Be sure to enclose your operations in print() calls to see the results. Your output should simply be four lines with the number 8 appearing once on each line.
- Use a variable to represent your favorite number. Then, using that variable, create a message that reveals your favorite number. Print that message.
- Choose two of the programs you’ve written, and add at least one comment to each. If you don’t have anything specific to write because your programs are too simple at this point, just add your name and the current date at the top of each program file. Then write one sentence describing what the program does