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
natta225 [31]
3 years ago
8

Write the function lettersOnly(s) that takes in a string called s, and returns a string containing only the alphabetic character

s of s.
Computers and Technology
1 answer:
Phantasy [73]3 years ago
4 0

Answer:

The program to this question as follows:

Program:

def lettersOnly(s): #defining method lettersOnly

   val="" #defining string variable that return value

   for i in s: #defining loop to calculate value

       if(i.isalpha()): #check condition that value is string

           val=val+ i #add value

   return val #return value

print(lettersOnly("data3base_ro1c3k5s")) #call method and print value

Output:

databaserocks

Explanation:

In the above python code, a method lettersOnly is declared that accepts a string variable  "s" in its parameter. Inside the method, a string variable "val", and loop is declared, in which the "val" variable holds method return value.

  • In the loop and if block is used that uses "isalpha" string method, which checks the check alphabetic character in the given value. if this is true it will calculate all value in "val" variable and return its value.    
  • At the last, the print method is used, which calls the lettersOnly method and prints its return value.
You might be interested in
I need help with Microsoft.
Ipatiy [6.2K]
No clue bro. Im in middle school thats y
7 0
3 years ago
What service in Windows Server 2016 authenticates remote users and computers to the Windows domain and its corporate network res
Citrus2011 [14]

Answer:

"Direct access" is the correct answer for the above question .

Explanation:

  • Direct access is a feature available in the window server of the 2016 version. It is used to allow access to the computer system program and the internet remotely behaves like that computer or network is his computer or network.
  • It allows remote users to do anything with the help of an internet connection. But it can be done with the authorization of valid users.
  • The above question states about the features which grant to access the internet for the remote users and this is available in window server 2016. This feature is known as "Direct access".
7 0
3 years ago
Which are the two alternatives for pasting copied data in a target cell or a group of cells ?
dlinn [17]
First, you click and drag the letters/images you wanna copy, you do Ctrl + C then you clikc another cell until you get the flashing line, do Ctrl + V and there you go
4 0
4 years ago
Read 2 more answers
State the difference between a file and a folder
Delicious77 [7]

Answer: A file is the common storage unit in a computer, and all programs and data are "written" into a file and "read" from a file. A folder holds one or more files, and a folder can be empty until it is filled. A folder can also contain other folders, and there can be many levels of folders within folders.

Explanation:

4 0
3 years ago
For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
Marrrta [24]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

int main()

{

// Declare variables

int childticket, adultticket, childprice, adultprice;

double total, net, distributor;

string movie;

// Prompt user for name of movie

cout<<"Movie Name; ";

// Accept input for movie name

cin>>movie;

// Prompt user and accept input for price of adult tickets

cout<<"Adult Ticket Price: $";

cin>>adultprice;

// Prompt user and accept input for price of child tickets

cout<<"Child Ticket Price: $";

cin>>childprice;

// Prompt user and accept input for number of sold adult tickets

cout<<"Adult Ticket Sold: ";

cin>>adultticket;

// Prompt user and accept input for number of child tickets sold

cout<<"Child Ticket Sold: ";

cin>>childticket;

// Calculate total

total = childticket * childprice + adultticket * adultprice;

// Calculate distributor's payment

distributor = 0.25 * total;

// Calculate net box pay

net = 0.75 * total;

// Display and format results

cout<<"Gross Box Office Revenue: $";

printf("%.2f",total);

cout<<"\n Amount Paid to Distributor: -$";

printf("%.2f", distributor);

cout<<"\nNet Box Office Revenue: $";

printf("%.2f",net);

return 0;

}

6 0
3 years ago
Other questions:
  • Using commands you learned in lessons 1 and 2. Get your IP address, netmask, DNS hostname, and MAC address. Compare these with y
    5·1 answer
  • Which method of encryption is based on physics principles?
    5·1 answer
  • Most panoramic photography focuses on what subject?
    9·2 answers
  • One of the earliest uses of an electronic digital computer involved ________.
    8·1 answer
  • Write a program that reads a file containing text. Read each line and send it to the output file, preceded by line numbers. If t
    8·1 answer
  • The Python MySQL Connector library:
    15·1 answer
  • In the ______ algorithm, the disk arm starts at one end of the disk and moves toward the other end, servicing requests till the
    11·1 answer
  • What are the tyoe of typical application of mainframe computer<br>​
    6·1 answer
  • Select the statement which most accurately describes the benefits and drawbacks of working from home and telecommuting.
    13·2 answers
  • Define a toString prototype method that returns the cat's name, gender, and age separated by semicolons.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!