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
Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
IrinaK [193]

Answer:

Hardware layer

Explanation:

The hardware layer's job is to maintain and put to action central processor units and memory. Hardware layer first check the availability of the for mentioned duo and then decides the need to put one or another into action. Physical and data link layers act the same in the hardware layer. They bot are waiting to be called in action

6 0
3 years ago
Which two tools used for incident detection can be used to detect anomalous behavior, to detect command and control traffic, and
allsm [11]

Netflow and IDS (intrusion detection system) are the two tools used for incident detection can be used to detect anomalous behavior, to detect command and control traffic, and to detect infected hosts.

The Netflow is CISCO feature used for collecting IP traffic information and monitoring network traffic on a specific interface. Similar to this, IDS is an a<span>pplication that monitors a network or systems for malicious activity or policy violations.</span>

8 0
4 years ago
What is the film format that many filmmakers feel is superior to any other format?
Kobotan [32]

Answer:

digital

Explanation:

7 0
3 years ago
windows 10 brought back the desktop, and gives the option to use either the start screen or desktop with a new tiled___
levacccp [35]

Answer:



A new tiled background

5 0
3 years ago
_is necessary for the health growth of bones and teeth fill ups​
alekssr [168]

Answer:

Calcium

Explanation:

Calcium is a necessity and makes your bones stronger. It typically comes in milk.

7 0
4 years ago
Read 2 more answers
Other questions:
  • The project started the development of inter-network connections using tcp/ip that has evolved into the internet today.
    5·1 answer
  • Because public key encryption requires the use of two different keys, it is also known as _____ encryption
    13·1 answer
  • Help me out with this .....
    10·1 answer
  • Will technology be the destruction or salvation of human-kind
    13·2 answers
  • What symbol shows autocorrect is in use in access? WILL MARK BRAINLIEST FOR WHOEVER ANSWERS FIRST!!!
    5·1 answer
  • Software that is decided to intentionally causing harm to a device, server, or network is 
    13·2 answers
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • Which is an advantage of using a flat file instead of a relational database?
    5·1 answer
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • What are two best practices for creating ads? (Choose two.) Select All Correct Responses Implement one ad per ad group per keywo
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!