0% found this document useful (0 votes)
5 views2 pages

HHHHHH

The document outlines a Python program that processes the name 'Muhammad Muhsin Muktar' and displays various transformations such as converting to uppercase, extracting the first and last letters, and reversing the name. It also updates the age from 17 to 18 and displays the final information including name, age, and course. The program demonstrates basic string manipulation and variable reassignment in Python.

Uploaded by

mahmudumar316
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

HHHHHH

The document outlines a Python program that processes the name 'Muhammad Muhsin Muktar' and displays various transformations such as converting to uppercase, extracting the first and last letters, and reversing the name. It also updates the age from 17 to 18 and displays the final information including name, age, and course. The program demonstrates basic string manipulation and variable reassignment in Python.

Uploaded by

mahmudumar316
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

• Name: Muhammad Muhsin Muktar

• ID Number: BU/24C/IT/11417
• Course: Software Engineering

Python code
# Step 1 & 2: Create variables and assign values
name = "Muhammad Muhsin Muktar "
age = 17
course = "Software Engineering "

# Step 3: Display the name in uppercase


name_upper = name.upper()
print("Name in uppercase:", name_upper)

# Step 4: Extract the first letter of the name using indexing


first_letter = name[0]
print("First letter of the name:", first_letter)

# Step 5: Extract the last letter of the name using negative indexing
last_letter = name[-1]
print("Last letter of the name:", last_letter)

# Step 6: Reverse the name using slicing with a step count of -1


reversed_name = name[::-1]
print("Reversed name:", reversed_name)

# Step 7: Reassign a new value to the age variable and display it


age = 18 # Changing the age
print("Updated age:", age)

# Step 8: Display all information


print("\nFinal Information:")
print("Name:", name)
print("Age:", age)
print("Course:", course)

Program Output
Name in uppercase: MUHAMMAD MUHSIN MUKTAR
First letter of the name: M
Last letter of the name: R
Reversed name: ratkuM nishuM dammahuM
Updated age: 18

Final Information
Name: Muhammad Muhsin Muktar
Age: 18
Course: Software Engineering

You might also like