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
Karolina [17]
3 years ago
13

Write a program that prompts the user to enter a string (may contain spaces) and displays its last character. Enter s string: Pr

ogramming is fun The last character is n
Computers and Technology
1 answer:
STALIN [3.7K]3 years ago
3 0

Answer:

<em>The programming language in Python is as follows:-</em>

#Prompt user for input string

userinput = input("Enter a string: ")

#Print the last character of the input

print("The last character is "+userinput[-1])

#End of Program

Explanation:

This line is a comment

#Prompt user for input string

This line prompts user for input

userinput = input("Enter a string: ")

This line is also a comment

#Print the last character of the input

This next line prints the last character of the input string; the last character is defined by the index -1

print("The last character is "+userinput[-1])

You might be interested in
Given a Student class, create a class with following characteristics:
Kay [80]

Answer:

ssume that,

Maximum “students” count can be 10.

*Driver Class*

*Solution class*

import java.util.*;

class Student {

private String name;

private int rollNo;

public String getName() {}

public void setName(String name) {}

public int getRollNo() {}

public void setRollNo(int rollNo) {}

};

class ClassRoom {

private int i;

private Student[] students;

public void addStudent(String name, int rollNo) {}

public Student[] getAllStudents() {}

};

8 0
3 years ago
I need help with this work
lisabon 2012 [21]

Answer:

B. Balanced depending and the type of questions

5 0
3 years ago
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
ANTONII [103]

Answer:

a) the average CPI for machine M1 = 1.6

the average CPI for machine M2 = 2.5

b) M1 implementation is faster.

c) the clock cycles required for both processors.52.6*10^6.

Explanation:

(a)

The average CPI for M1 = 0.6 x 1 + 0.3 x 2 + 0.1 x 4

= 1.6

The average CPI for M2 = 0.6 x 2 + 0.3 x 3 + 0.1 x 4

= 2.5

(b)

The average MIPS rate is calculated as: Clock Rate/ averageCPI x 10^6

Given 80MHz = 80 * 10^6

The average MIPS ratings for M1 = 80 x 10^6  / 1.6 x 10^6

= 50

Given 100MHz = 100 * 10^6

The average MIPS ratings for M2 = 100 x 10^6 / 2.5 x 10^6

= 40

c)

Machine M2 has a smaller MIPS rating

Changing instruction set A from 2 to 1

The CPI will be increased to 1.9 (1*.6+3*.3+4*.1)

and hence MIPS Rating will now be (100/1.9)*10^6 = 52.6*10^6.

7 0
3 years ago
What is web browser <br>​
xeze [42]
An application used to access and view websites
7 0
3 years ago
Read 2 more answers
Write a Python program to convert the characters to lowercase in a string
wel

Answer:

Following is the program in the python language

st = 'sAN RaN'  #String

print(st.lower()) #display into the lowercase

Output:

san ran

Explanation:

Following are the description of program

  • Declared and initialized the string in the "st" variable .
  • The lower function in python is used for converting the uppercase string into the lower case string .
  • Finally in the print function we used lower function and display the  string into the lower case
8 0
3 years ago
Other questions:
  • In Java :
    11·1 answer
  • You work administrative assistant in an engineering firm. A co-worker constantly makes fun of the engineers by whispering commen
    13·1 answer
  • Hi, I have several computer questions. These refer to the history of the internet. I would like to know if everything we look fo
    12·1 answer
  • When creating a software package, the software must be designed, the code must be written, and then the code must be tested. Thi
    6·1 answer
  • Take some time to do some research about small businesses in your area. Select one and using HTML design a simple site that educ
    11·1 answer
  • CHALLENGE ACTIVITY 4.2.2: Basic while loop with user input. Write an expression that executes the loop while the user enters a n
    14·1 answer
  • How many bytes are there in 256 Kbytes?
    6·1 answer
  • HI How are you anyways are any of you intreseted in my giveaway
    7·2 answers
  • Ninety percent of the fastest-growing jobs require some kind of postsecondary education.
    7·1 answer
  • Which of the following is not an advanced strategy you may use to help you conduct a search on the Internet?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!