egyptforrest6472 egyptforrest6472
  • 29-10-2020
  • Computers and Technology
contestada

INSTRUCTIONS RUN CODE GRADING HISTORY Write code to take a String input from the user, then print the first and last letters of the string on one line. Sample run: Enter a string: surcharge se

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 29-10-2020

Answer:

Written in Python

userinput = input("Enter a string: ")

print(userinput[0]+userinput[-1])

Explanation:

The code is straight forward and self explanatory.

The first line prompts user for input

userinput = input("Enter a string: ")

This line gets and prints the first and last character of user input

print(userinput[0]+userinput[-1])

Answer Link

Otras preguntas

Oberweis creates products and services that meet customer needs, prices them competitively, distributes the products and services, and communicates the products
HELP ASAP!! WILL MARK BRAINLIST!! A LOT OF POINTSS
What is 1/8 + c = 4/5
f r(x) = 3x – 1 and s(x) = 2x + 1, which expression is equivalent to ?
Please answer!! thank u i will give brainliest
Why did Christians attack Jews during the Crusades? They wanted revenge for Jewish attacks on Christians Jews were trying to regain the Holy Land for themselv
What state was the first to grant women full voting rights
find f(-2) if f(x)=x^4+2x^2-1
Given the parent function
Ralph is always thirsty and recently learned that he synthesizes mutated antidiuretic hormone (ADH). Discuss why Ralph would be at risk for insipidus diabetes ​