This program crashes because of the quotes and the backslash. Fix each string using escape characters (keep the double quotes around every string): quote must hold: He said “Selam!” sentence must hold: It’s hot in Massawa path must hold: C:\Users\Abel …
Create three strings with f-strings so the price list lines up in two columns: header — the text Item left-aligned in 10 characters, then Price right-aligned in 8 characters row1 — item1 left-aligned in 10, then price1 right-aligned in 8 …
Using an f-string, create a variable message that uses name and total to make this exact text, with the total shown with 2 decimal places: Hello Selam, you owe 152.50 Nakfa Then print message.
Merhawi buys 4 kilos of tomatoes at 30 Nakfa per kilo. Using the given variables, create: line — 20 equals signs, made with * receipt — “Tomatoes x 4 = 120 Nakfa”, built with + and str(). Let Python calculate …
Using the variables first and last, create: full_name — the first name, a space and the last name: “Abel Tesfay” greeting — “Hello, ” + full_name + “!” Use + for both. Then print greeting. Expected output: Hello, Abel Tesfay!
A shop notice was typed badly: notice = ” the price in asmara is 20 nakfa “. Create result: remove the spaces at both ends, replace “20” with “25”, and turn it into capitals. Create words by splitting result into …
Two strings are given. Create: clean — raw with the spaces removed from both ends and all letters in capitals (“KEREN”) new_message — message with “Asmara” replaced by “Keren” Print clean, then new_message. Expected output: KEREN I love Keren
Given date = “2026-11-29” and word = “Nakfa”, create: year — “2026”, using a slice month — “11”, using a slice day — “29”, using a slice with a negative index backwards — word reversed, using a step of -1 …
Given city = “Massawa”, create three variables using indexes and slicing: first — the first character last — the last character (use a negative index) first_three — the first three characters Print them in that order. Expected output: M a …
Create a variable address that holds this text over three lines, using a triple-quoted string. Start the text directly after the opening “”” so that there is no empty first line. Selam Tesfay Harnet Avenue Asmara Then create: first_letter — …
