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
Sati [7]
3 years ago
5

True or False: To create a function in python, you start with the keyword "def"

Computers and Technology
2 answers:
Butoxors [25]3 years ago
8 0

Answer:

true i think

Explanation:

Katyanochek1 [597]3 years ago
6 0

Answer:

true

Explanation:

i saw the other answer and wanted to contribute to your knowledge

You might be interested in
Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
Lelu [443]

Answer:

see explaination

Explanation:

def words2number(s):

words = s.split()

numbers = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']

result = ""

for word in words:

if word in numbers:

result += str(numbers.index(word))

return result

4 0
3 years ago
Read 2 more answers
How many times do you need to click the format painter button to apply copy formats to multiple paragraphs one right after the o
IRISSAK [1]
U have to double-click for multiple paragraphs instead of single click

5 0
3 years ago
When looking at a maple tree, you learn that many maple tree leaf cells are capable of creating food from the sun and sustaining
Usimov [2.4K]

it tells you that the sun give the msple tree energy to produce food for its leaf's and if it can no longer produce enough energy to make food for the leaf's of the maple tree then the tree will either die of no energy or die of no leaf's to give the soil's food for the tree

4 0
3 years ago
You have been asked to write a username validation program for a small website. The website has specific rules on what constitut
umka21 [38]

Answer:

#function to validate username

def valid_username(username):

   

   #checking is length is between 8 to 15

   length_valid=True

   if(len(username)<8 or len(username)>15):

       length_valid=False;

   

   #checking is string is alphanumeric

   alphanumeric=username.isalnum()

   

   #checking first_and_last Characters of string is not digit

   first_and_last=True

   if(username[0].isdigit() or username[len(username)-1].isdigit()):

       first_and_last=False

   

   #counting uppercase lowercase and numeric Characters in string

   uppercase=0

   lowercase=0

   numeric=0

   

   for i in username:

       if(i.isdigit()):

           numeric=numeric+1

       elif(i.isalpha()):

           if(i.isupper()):

               uppercase=uppercase+1

           else:

               lowercase=lowercase+1

               

   valid_no_char=True

   if(uppercase<1 or lowercase<1 or numeric<1):

       valid_no_char=False

           

 

   #printing the result

   print("Length of username: "+str(len(username)))

   print("All Characters are alpha-numeric: "+str(alphanumeric))

   print("First and last Character are not digit: "+str(first_and_last))

   print("no of uppercase characters in the username: "+str(uppercase))

   print("no of lowercase characters in the username: "+str(lowercase))

   print("no of digits in the username: "+str(numeric))

   

   #checking string is Valid or not

   if(length_valid and alphanumeric and first_and_last and valid_no_char):

       print("Username is Valid\n")

       return True

   else:

       print("username is invalid, please try again\n")

       return False

#loop runs until valid_username enterd by user

while(True):

   

   username=input("Enter a username: ")

   if(valid_username(username)):

       break

Explanation:

The code was created by considering all the required cases asked in the question.

In this program, I asked username from the user continuously until it enters a valid username

first it check for length of string

then check is string contains only alphanumeric characters

then first and last digit is or not

than no of uppercase lowercase and numeric character

using the above parameter declare username valid or not

3 0
3 years ago
What is the name of the first program created using Scratch?
disa [49]

Answer:

Weekend

Explanation:

Scratch is a type of programming language that is block-based and has children as its target audience. With this, users can make online projects using the program interface.

The name of the first program created using Scratch was created and named Weekend.

6 0
3 years ago
Other questions:
  • It is used to replace numeric number of a website​
    7·1 answer
  • Need deveolpers not software
    10·2 answers
  • Develop a simple game that teaches kindergartners how to add single-digit numbers. Your function game() will take an integer n a
    11·1 answer
  • Is greedy algorithm non deterministic by nature?
    13·1 answer
  • Rachel typed two paragraphs and then realized she was in the wrong document. What steps should Rachel follow to quickly move the
    15·2 answers
  • Which software documentation guideline did the IEEE establish?
    10·1 answer
  • CALLING ALL DEKUS UWU
    15·2 answers
  • Sebutkan contoh komputer analog, komputer digital, dan komputer hybrid
    9·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
  • Consider the following statements regarding computers:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!