Question: I've finished the program, but I am unable to fulfill a requirement. How do I iterate through the collection displaying the output as a complete

I've finished the program, but I am unable to fulfill a requirement. How do I iterate through the collection displaying the output as a complete sentence using each value, using the f-string format to control the output?
I'm using python. This is the code so far:
prog_lang =("C++","C","C#","Carbon","Kotlin","Java","Rust","Python","Fortran","Bash","PHP","Basic","Go","F#","Dart","Swift","Ruby","Julia","Scala","Haskell","LOLCode")
print("The thing of languages is "+ str(prog_lang)+"
")
print("Wait, let's try that again.
The thing of languages is:", end="")
for prog in prog_lang:
if prog != prog_lang[-1]:
print(prog, end =",")
else:
print("and "+ prog +".")
gnal_gorp = prog_lang[::-1]
print("
The reverse thing of languages is:", end="")
for prog in gnal_gorp:
if prog != gnal_gorp[-1]:
print(prog, end =",")
else:
print("and "+ prog +".")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!