All questions

# Problem 1 ### Write a Python script to create HTML tags around the word. Use string formatting.

1
2
3
4
5
word = "python"
element = "i"

Output:
<i>python</i>

# Problem 2 ### Write a Python script to remove the newline character.

1
2
3
4
word = "Remove the newline \n"

output: 
"Remove the newline"

# Problem 3 ### Write a Python script to reverse a string and to reverse the words within the string.

word = "Reverse this string"

# Problem 4

Write a Python function to swap commas and dots in a string.

1
2
3
4
5
def swap(num):
    # Do script here
swap(num = "32.054,23")

Output: "32,054.23"

# Problem 5

Write a Python function Write a Python program to swap cases in a given string.

1
2
3
4
5
6
def swap_case(string):
    # Do script here
swap_case(string = "Python Is Cool")

Output:
pYTHON iS cOOL