1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
geniusboy [140]
4 years ago
11

1. Write a program that asks the user to enter a string. The program should then print the following: (a) The total number of ch

aracters in the string (b) The string repeated 10 times (c) The first character of the string (remember that string indices start at 0) (d) The first three characters of the string (e) The last three characters of the string (f) The string backwards (g) The seventh character of the string if the string is long enough and a message otherwise (h) The string with its first and last characters removed (i) The string in all caps (j) The string with every a replaced with an e
Computers and Technology
1 answer:
Kazeer [188]4 years ago
6 0

Answer:

s = input("Enter a string: ")

print(len(s))

print(s*10)

print(s[0])

print(s[:3])

print(s[len(s)-3:])

print(s[::-1])

if len(s) >= 7:

   print(s[6])

else:

   print("The string is not long enough")

print(s[1:len(s)-1])

print(s.upper())

print(s.replace("a", "e"))

Explanation:

*The code is in Python.

Ask the user to enter a string

Use len method to get the total number of characters

Use "*" to repeat 10 times

Use index, 0,  to get first character

Use slicing to get first three characters

Use slicing to get last three characters

Use slicing to get it in backwards

Check if the length is greater than or equal to 7. If it is, use index, 6. Otherwise, print a message.

Use slicing to remove first and last characters

Use upper method to get it in all caps

Use replace method to replace the "a" with the "e"

You might be interested in
To deny a host from sending HTTP traffic destined to a specific server you will need to apply a __________ Access Control List.
DedPeter [7]

I would a Standard Access control List

There are two common access lists: The standard and extended access list.  With the standard access list, it creates filters only on source addresses and is commonly used for server-based filtering. They are not as powerful as extended access lists. Standard Access lists are typically used for restricting access to a router through HTTP and HTTPS.  


6 0
3 years ago
Read 2 more answers
An integer is said to be a perfect number if the sum of its divisors, including 1 (but not the number itself), is equal to the n
kirill115 [55]
True

explanation: bc it is
8 0
3 years ago
Can we change the format of a field (e.g. Number to Dollars).
mixer [17]

I think the answer is

3 - Usually, but we may need to convert the data types (date to text)

Because we can change the format, but depends of the original format type and in what type you need to format.

I think this can help.

3 0
4 years ago
A window may be resized by dragging the___ or side of it
dangina [55]

top i believe is the answer


4 0
4 years ago
Read 2 more answers
A network administrator enters the service password-encryption command into the configuration mode of a router. What does this c
Ad libitum [116K]

Answer:

A network administrator enters the service password-encryption command into the configuration mode of a router. What does this command accomplish? This command prevents someone from viewing the running configuration passwords. You just studied 28 terms!

3 0
3 years ago
Other questions:
  • 14. Emelia is very concerned about safety and has conducted a study to determine how many bike helmets were replaced at each loc
    13·2 answers
  • What is information reach? A. A global public network of computer networks that pass information from one to another using commo
    5·1 answer
  • The basic components of cartridges and shotshells are similar. Shot pellets and a bullet are examples of which basic component?
    13·1 answer
  • Calculate the average of a set of grades and count
    9·1 answer
  • Carly’s Catering provides meals for parties and special events. Write a program that prompts the user for the number of guests a
    10·1 answer
  • Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
    5·1 answer
  • Complete the function to return the factorial of the parameter,
    9·2 answers
  • What is 11100111 to decimal form?
    9·2 answers
  • What does c++ programming mean?
    7·1 answer
  • You are given an integer N where 0 <= N <= 100, followed by another line of input which has a word W with length L where 1
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!