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
seraphim [82]
2 years ago
9

What statement is used to close a loop started with a for statement?

Computers and Technology
1 answer:
liraira [26]2 years ago
5 0
If I get what you are saying then you could use a work like end. :)
You might be interested in
Building a String Library
maw [93]
Code:

def myAppend( str, ch ):
# Return a new string that is like str but with
# character ch added at the end
return str + ch

def myCount( str, ch ):
# Return the number of times character ch appears
# in str.

# initiaalizing count with 0
count = 0

# iterating over every characters present in str
for character in str:
# incrementing count by 1 if character == ch
if character == ch:
count += 1

# returning count
return count


def myExtend( str1, str2 ):
# Return a new string that contains the elements of
# str1 followed by the elements of str2, in the same
# order they appear in str2.

# concatenating both strings and returning its result
return str1 + str2

def myMin( str ):
# Return the character in str with the lowest ASCII code.

# If str is empty, print "Empty string: no min value"
# and return None.
if str == "":
print("Empty string: no min value")
return None

# storing first character from str in char
char = str[0]

# iterating over every characters present in str
for character in str:
# if current character is lower than char then
# assigning char with current character
if character < char:
char = character
# returning char
return char


def myInsert( str, i, ch ):
# Return a new string like str except that ch has been
# inserted at the ith position. I.e., the string is now
# one character longer than before.

# Print "Invalid index" if
# i is greater than the length of str and return None.

if i > len(str):
print("Invalid index")
return None

# str[:i] gives substring starting from 0 and upto ith position
# str[i:] gives substring starting from i and till last position
# returning the concatenated result of all three
return str[:i]+ch+str[i:]

def myPop( str, i ):
# Return two results:
# 1. a new string that is like str but with the ith
# element removed;
# 2. the value that was removed.
# Print "Invalid index" if i is greater than or
# equal to len(str), and return str unchanged and None
if i >= len(str):
print("Invalid index")
return str, None

# finding new string without ith character
new_str = str[:i] + str[i+1:]

# returning new_str and popped character
return new_str, str[i]

def myFind( str, ch ):
# Return the index of the first (leftmost) occurrence of
# ch in str, if any. Return -1 if ch does not occur in str.

# finding length of the string
length = len(str)

# iterating over every characters present in str
for i in range(length):
# returning position i at which character was found
if str[i]==ch:
return i
# returning -1 otherwise
return -1


def myRFind( str, ch ):
# Return the index of the last (rightmost) occurrence of
# ch in str, if any. Return -1 if ch does not occur in str.

# finding length of the string
length = len(str)

# iterating over every characters present in str from right side
for i in range(length-1, 0, -1):
# returning position i at which character was found
if str[i]==ch:
return i
# returning -1 otherwise
return -1

def myRemove( str, ch ):
# Return a new string with the first occurrence of ch
# removed. If there is none, return str.

# returning str if ch is not present in str
if ch not in str:
return str

# finding position of first occurence of ch in str
pos = 0

for char in str:
# stopping loop if both character matches
if char == ch:
break
# incrementing pos by 1
pos += 1

# returning strig excluding first occurence of ch
return str[:pos] + str[pos+1:]

def myRemoveAll( str, ch ):
# Return a new string with all occurrences of ch.
# removed. If there are none, return str.

# creating an empty string
string = ""

# iterating over each and every character of str
for char in str:
# if char is not matching with ch then adding it to string
if char!=ch:
string += char
# returning string
return string

def myReverse( str ):
# Return a new string like str but with the characters
# in the reverse order.

return str[::-1]
6 0
2 years ago
Learning from and working collaboratively with individuals is being literate in which area
solniwko [45]
I think it should be civic literacy
7 0
3 years ago
Read 2 more answers
Applying Time Management Techniques
tatuchka [14]

Answer:

Most students start out each new semester of school with high expectations. They envision themselves being successful in their studies and school work but they fail to put together a realistic plan, or establish a routine, that will enable them to achieve academic success. There are only so many hours in a day, days in a week, and weeks in a term. And if you don't pay attention, the end of the semester will arrive before you know it – catching you by surprise. To achieve academic success, you must carefully manage your study time on a daily, weekly, and semester basis. The following is a time management strategy for doing exactly that.

Explanation:

7 0
3 years ago
You are a part-time manager for The Mobile Vegan, a food truck catering to vegan diners in Portland, Oregon. Jessica Rosen, the
Nesterboy [21]

Answer:

i acc dont know

Explanation:

srry

5 0
2 years ago
Help teacher said with complete explanation ​
atroni [7]

Answer:

use the first graph to help you find out

5 0
2 years ago
Other questions:
  • Peter works on a huge database of numerical figures in a worksheet ranging from cell A1 to cell I50. He has to print the workshe
    10·2 answers
  • You are given 4-bit ripple carry adders and logic gates you have learnt about in the class (AND, OR, NOT, XOR, XNOR, NAND, NOR).
    15·1 answer
  • For this project, you'll be given information to create a business report using word processing software. Suppose you want to op
    11·1 answer
  • Power point how to insert diamond symbol
    7·1 answer
  • What are some options available when you click File and then Print? (Multiple Choice)
    5·1 answer
  • NAT ________. allows a firm to have more internal IP addresses provides some security both allows a firm to have more internal I
    5·1 answer
  • Write a program and flowchart. The program should ask the user for the average temperature in each of the last 12 months. After
    14·1 answer
  • The system where the unit of measurement is centimeter
    15·1 answer
  • Data is best described as
    5·2 answers
  • Which type of protocol provides a way to transfer files from one computer to another over any tcp/ip network, such as a lan or t
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!