• Register
0 votes
106 views

Problem:

Write an expression whose value is the str that consists of the third to last character of the str associated with s

I tried s[2:]

didn't work.

Can you please guide me with right solution?

7 5 3
5,380 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

I saw you answer which you tried, but notice that you are little bit wrong.
 
You can try it : s[3]
 
It will work.  
8 5 2
10,530 points

Related questions

0 votes
1 answer 162 views
162 views
Problem: I am new in programming and stuck in a query, can anyone guide me? Write an expression that evaluates to True if the str associated with s starts with "p"?
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 67 views
67 views
Problem: Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not? Write an expression that whose value is the fifth character of the String name?
asked Feb 24, 2020 maddi86 5.4k points
0 votes
1 answer 90 views
90 views
Solutions: I am new in programming and my logic is not good, can anyone give the right solution? Write an expression that evaluates to true if and only if the C-string s equals the C-string "end"?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 24 views
24 views
Problem: I am new to programming, I need help, can anyone help me? Write an expression that evaluates to True if and only if s refers to the str "end"?
asked Feb 18, 2020 maddi86 5.4k points
0 votes
2 answers 71 views
71 views
Problem: I am new in programming, I need help, can anyone help me? Declare an integer constant, MONTHS_IN_YEAR, whose value is 12?
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 62 views
62 views
Problems: Can anyone give the right solution? Write a literal representing the false value?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 26 views
26 views
Problem: Hello! I am a beginner and got an assignment for writing an expression that returns the last digit of an integer number. I got no idea how to do that. I have seen the solutions of many fellows, which was number % 10, or something like this but could not understand their answers. If any of you could give the solution with a detailed explanation of that, I would be so grateful. Thanks!
asked Nov 30, 2020 Code Learner 5.5k points
0 votes
1 answer 25 views
25 views
Problem: Hi there! I am new to the world of programming. My programming teacher gave me an assignment in which I have to write a program in which there would be a function that will take two strings as input from user and will compare the size of both strings ... the larger string of the two. I have no clue how to do that. Please provide me with the sample program with proper description. Thanks
asked Nov 25, 2020 Code Learner 5.5k points
0 votes
2 answers 249 views
249 views
Problem: I am new to programming, so need query to get query to return max number from 3 integer? Write the definition of a method max that has three int parameters and returns the largest? Can anyone guide with correct code?
asked Feb 17, 2020 maddi86 5.4k points
0 votes
2 answers 59 views
59 views
Problems: I am new to programming, I need help, can anyone help me? Declare a variable isACustomer suitable for representing a true or false value?
asked Feb 14, 2020 maddi86 5.4k points