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
natita [175]
2 years ago
11

assume that name is a variable of type stirng that has been assigned a value write an expression whose value is the last charact

er of the value of name..."blair"...'r'....
Computers and Technology
1 answer:
Snezhnost [94]2 years ago
7 0

Answer:

The most straight forward way to do it: in general string are zero index based array of characters, so you need to get the length of the string, subtract one and that will be the last character, some expressions in concrete languages would be:

In Python:

name = "blair"

name[len(name) - 1]

In JavaScript:

name = "blair"

name[name.length - 1]

In C++:

#include <string>

string name = "blair";

name[name.length() - 1];

You might be interested in
Different algorithms can be made to complete the same task in different ways.
musickatia [10]

Answer:

True hope this helps you and everyone!

7 0
3 years ago
Read 2 more answers
My ar goal is 16.3 what percent am i at if i have 3 points??
Mazyrski [523]

24 percent so far so keep working at that goal

5 0
3 years ago
Write a JavaScript program to generate the following pattern but the number of rows should be user input.
Nookie1986 [14]

Answer:

Testicles

Explanation:

u sukkk

3 0
2 years ago
Write a function called getChar that has no function inputs, but takes in two character inputs from the user (in1 and in2) and o
bearhunter [10]

Answer:

def getChar():

   while True:

       in1 = input('Enter first char: ')

       try:

           if len(in1) != 1:

               raise

           else:

               in2 = input('Enter second char: ')

               if len(in2) != 1:

                   raise

               else:

                   break

       except:

           print('Enter just one character')

   return in1, in2

def chars2string(in1,in2):

   print(in1*5 + in2*5)

def main():

   ls = getChar()

   in1 = ls[0]

   in2 = ls[1]

   chars2string(in1, in2)

if __name__ == '__main__':

   main()

Explanation:

The programming language used is python 3.

The script first defines a function getChar and makes use of a while loop in combination with try and except blocks and IF statements, the code ensures that both inputs that are entered by the user after the prompt are 1 in length. i.e. Just one character. This function returns the two characters that were entered.

The second function that is defined is chars2string this function takes two arguments, It repeats each argument five times and returns a joined string.

Finally, the main function is defined and it calls the getChar function  first, the values that are returned by this function is assigned to two variables, that is then passed on to the chars2string function. The main function is called and the Joined string is printed to the screen.

3 0
3 years ago
The ________________ Act requires Internet sales to be treated in the same way as mail-order sales (e.g., collect sales tax from
BARSIC [14]

Answer:

Internet Tax Freedom Act

Explanation:

The Internet Tax Freedom Act was signed into law in 1998 by President Bill Clinton and has since been reviewed until the Permanent Internet Tax Freedom Act was passed into law on the 9th of June, 2015 by President Barrack Obama.

The Act requires that internet sales are equally treated as mail-order sales.

5 0
3 years ago
Other questions:
  • What is one way to maintain Internet safety? a) avoid interacting with people on the Internet. B) avoid giving out information a
    7·1 answer
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • Utility software is also known as _____​
    11·1 answer
  • For which of the following careers is technology’s connectivity factor most important?
    13·2 answers
  • Dedicated server hosting and dedicated web dedicated is the same ??????
    14·1 answer
  • The study of a current business and information system application and the definition of user requirements and priorities for a
    5·1 answer
  • What is wrong with this code and correct it.
    12·1 answer
  • Draw AND, OR, XOR and XNOR gates with truth table and logic gates.<br><br>.​
    11·1 answer
  • Cloud-based services can open doors to leveraging Artificial Intelligence (AI) without dramatically increasing risk. Which clien
    9·1 answer
  • Ninety percent of the fastest-growing jobs require some kind of postsecondary education.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!