Question
I have these questions All are supposed to be written in Python 2. Assume that the variable data refers to the string myprogram.exe. Write the
I have these questions All are supposed to be written in Python
2. Assume that the variable data refers to the string myprogram.exe. Write the expressions that perform the following tasks:
a Extract the substring gram from data.
b Truncate the extension .exe from data.
c Extract the character at the middle position from data.
3 Assume that the variable myString refers to a string. Write a code seg- ment that uses a loop to print the characters of the string in reverse order.
4 Assume that the variable myString refers to a string, and the variable reversedString refers to an empty string. Write a loop that adds the characters from myString to reversedString in reverse order
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started