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
ser-zykov [4K]
3 years ago
14

Python 3 (not java)1.Assume that word is a variable of type String that has been assigned a value. Write an expression whose val

ue is a String consisting of the last three characters of the value of word. So if the value of word were "biggest" the expression's value would be "est".2.Given three String variables that have been given values, firstName, middleName, and lastName, write an expression whose value is the initials of the three names: the first letter of each, joined together. So if firstName, middleName, and lastName, had the values "John", "Fitzgerald", and "Kennedy", the expression's value would be JFK". Alternatively, if firstName, middleName, and lastName, had the values "Franklin", "Delano", and "Roosevelt", the expression's value would be "FDR".3.Write an expression that evaluates to True if and only if the variables profits and losses are exactly equal.
Computers and Technology
1 answer:
zhenek [66]3 years ago
8 0

Answer:

#part 1.

#declare and initialize string variable word

word="welcome"

# extract the last 3 characters of the string and print

print("last 3 characters of word is: ",word[-3:])

#part 2.

#declare and initialize string variables

firstName="John"

middleName="Fitzgerald"

lastName="Kennedy"

#print the initials of all names

print("initials of name is: ",firstName[0]+middleName[0]+lastName[0])

#part 3.

#declare and initialize profit and loss

profits=10

losses=10

# if will be true only when profits equals to losses

if profits==losses:

   print("both are equal")

Explanation:

In part 1, declare and initialize string variable word with "welcome" then extract last 3 characters of the string and print it. In part 2, declare and initialize names variable then find the first character of each name that is character at 0 index. Append all 3 and print that value. In part 3, declare and initialize profits with 10 and losses with 10. In the if condition, it will print  "both are equal" if both values are equal.

Output:

last 3 characters of word is:  ome                                                                                            

initials of name is:  JFK                                                                                                    

both are equal

You might be interested in
What is the unemployment rate if the GDP gap is 13.5%?<br><br> A. 6.25%<br> B. 6.75%<br> C. 6.7%
Kamila [148]
I think it can be like 6.25%
6 0
4 years ago
Which method of accessing FTP has the most limited capabilities?
alexira [117]

Answer:

I think through a web browser as all OSs have a built in FTP client so it would be web browser

Explanation:

7 0
3 years ago
Read 2 more answers
When you develop an application using a 3-layer architecture, the layer that provides the user interface is called the _____ lay
alexdok [17]
<span>When you develop an application using a 3-layer architecture, the layer that provides the user interface is called the Presentation layer?</span>
5 0
3 years ago
SOMEBODY HELP ME ASAP PLEASE AND THANK YOU
Paha777 [63]

Answer:

Isnt there another thing that is supposed to be there like some website

Explanation:

7 0
3 years ago
Read 2 more answers
Injection attacks variants can occur whenever one program invokes the services of another program, service, or function and pass
velikii [3]

Answer:

True

Explanation:

In Computer science, It's true that injection attacks variants can occur whenever one program invokes the services of another program, service, or function and passes to it externally sourced, potentially untrusted information without sufficient inspection and validation of it.

5 0
3 years ago
Other questions:
  • Lana is trying to insert a table, but she does not like any standard table options that she is given. Which best describes what
    5·2 answers
  • Suppose a retailer who has no technology expertise wishes to set up an online presence for his business. He ________. a. ​can us
    6·1 answer
  • The outstanding disk requests are for tracks 6,10,4,20,36,8, and 40 in that order. Assume that the seek time speed is 5 msec/tra
    14·1 answer
  • What are 7 key traits for knowing your audience
    6·2 answers
  • 4. Where do you find the command to create bibliography citations or a table of contents?
    14·2 answers
  • which internet technology allows businesses to make presentation and share visual aids such as charts and graphs
    14·2 answers
  • Computers that have multiple CPUs within a single computer, sharing some or all of the system's memory and I/O facilities, are c
    15·1 answer
  • How does the Evaluate Formula dialog box help fix errors?
    9·2 answers
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • Which is an effect of short-term environmental changes?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!