Task 1 Write a Python program that will ask the user to input a string (containing exactly one word). Then your program should print subsequent substrings of the given string as shown in the examples...


please solve those questions by python with (.py) file


Task 1<br>Write a Python program that will ask the user to input a string (containing exactly one word). Then your program<br>should print subsequent substrings of the given string as shown in the examples below.<br>Example 1:\ Input: BANGLA\ Output:\ B\ BA\ BAN\ BANG\ BANGL\ BANGLA<br>Example 2:\ Input: DREAM\ Output:\ D\ DR\ DRE\ DREA\ DREAM<br>Hints(1): Need to use

Extracted text: Task 1 Write a Python program that will ask the user to input a string (containing exactly one word). Then your program should print subsequent substrings of the given string as shown in the examples below. Example 1:\ Input: BANGLA\ Output:\ B\ BA\ BAN\ BANG\ BANGL\ BANGLA Example 2:\ Input: DREAM\ Output:\ D\ DR\ DRE\ DREA\ DREAM Hints(1): Need to use "for loop" for this task. Hints(2): Need to use print() function for printing newlines. For example:\ print(1)\ print(2) Output:\ 1\2 We need use print(end = "") to skip printing the additional newline. For example:\ print(1, end =" ")\ print(2) Output:(prints the following output right next to the previous one)\ 12
Task 2<br>Write a Python program that will ask the user to enter a word as an input.<br>• If the length of the input string is less than 4, then your program should print the same string as an output.<br>• If the input string's length is greater than 3, then your program should add

Extracted text: Task 2 Write a Python program that will ask the user to enter a word as an input. • If the length of the input string is less than 4, then your program should print the same string as an output. • If the input string's length is greater than 3, then your program should add "er" at the end of the input string. • If the input string already ends with "er", then add "est" instead. • If the input string already ends with "est", then your program should print the same input string as an output. Example 1:\ Input: strong\ Output: stronger Example 2:\ Input: stronger\ Output: strongest Example 3:\ Input: strongest\ Output: strongest Example 4:\ Input: abc\ Output: abc In [ ]:

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here