100% Guaranteed Results


YWPython – Homework #1 Solved
$ 29.99
Category:

Description

5/5 – (1 vote)

1) Create a program that will print your identifications.
Example my identifications:
• Name: Alex
• Last name: Kuznetsov
• Age: 27
• Phone number: 0527389001

2) For a string that you created please check if:
The character at index 7 equals ‘a’.
The character at index 8 equals ‘b’.
The character at index 9 equals ‘c’. If all conditions exists please print “True”, Else print False.
Pay attention for edge cases like the length of the string and so on. Your program must not crash for any string.
3) Write a Python program to get a single string from two given strings, separated by a space and swap the first two characters of each string.

4) Write a Python program to add ‘ing’ at the end of a given string (length should be at least 3). If the given string already ends with ‘ing’ then add ‘ly’ instead. If the string length of the given string is less than 3, leave it unchanged.

5) For a string (three characters and more) that you have created please create a new string that follows the next rules:
• The first character of the new string is the middle character of the original string.
• The middle character of the new string is the last character of the original string.
• The last character of the new string is the first character of the original string.
Example:
• For odd length case, length of 9 characters:
Let’s assume that the middle character is 9/2 rounded down that’s means that it is 4. “afffbeeec” –> “bfffceeea”
• For even length case, length of 8 characters:
The middle character is also 4 because 8/2 equals 4.
“axxxbyyc” -> “bxxxcyya”
Print your new string in the following way, for even length example:
The rotated string is bxxxcyya

6) Write a Python function to insert a string in the space of the original string. You can assume that there is just one space in your string.

Challenges:

7) Write a Python program to sort a string lexicographically. Look For relevant method.

8) Write a Python program to print the following floating numbers upto 2 decimal places.

9) Write a Python program to count occurrences of a substring in a string. Look for a relevant method.

Reviews

There are no reviews yet.

Be the first to review “YWPython – Homework #1 Solved”

Your email address will not be published. Required fields are marked *

Related products