+ 1

Trying to solve Name please in python for beginnners

Don't know what is wrong my code It is giving me syntax error fname = input() lname = input() print(fname[1]. + lname[1].)

7th Apr 2021, 10:48 AM
Simisola Osinowo
Simisola Osinowo - avatar
10 odpowiedzi
+ 3
This is how I solved it. Easy to understand for beginner. fname = input() lname = input() x = fname[0] y = lname[0] print(x + "." + y + ".") #your code goes here
18th Jul 2021, 2:07 PM
Mark Fernando Maligmat
Mark Fernando Maligmat - avatar
+ 2
print(fname[0] + "." + lname[0]+".") You are try get 2nd letter. Remember Index starts with 0.
7th Apr 2021, 11:04 AM
Vadivelan
0
You need to take the first and last name of a person as input and output the initials (first letters of the first and last name). Sample Input James Smith Sample Output J.S.
7th Apr 2021, 10:48 AM
Simisola Osinowo
Simisola Osinowo - avatar
0
you just add the . after each index call to the name. erase the period. If you want the period, enclose them in quotes and "add" them to the other strings lname = Morgan fi = J mi = P print(fi + '. ' + mi + '. ' + lname) #output J. P. Morgan
7th Apr 2021, 11:04 AM
Slick
Slick - avatar
0
Thanks
7th Apr 2021, 11:05 AM
Simisola Osinowo
Simisola Osinowo - avatar
0
It is the best way to this: fname = input() lname = input() print(fname[0]+"." +lname[0]+".") it is correct.
22nd Sep 2021, 7:03 PM
Anuva Islam
Anuva Islam - avatar
0
fname = input() lname = input() print(fname[0] + "." + lname[0] + ".")
10th Jan 2022, 10:32 AM
Ihor Princ
Ihor Princ - avatar
- 2
Please can you help with this You’re analyzing a data set and need to remove the outliers (the smallest and largest values. The data is stored in a list). Complete the code to remove the smallest and largest elements from the list and output the sum of the remaining numbers.
7th Apr 2021, 11:32 AM
Simisola Osinowo
Simisola Osinowo - avatar
- 2
Vadivelan data = [7, 5, 6.9, 1, 8, 42, 33, 128, 1024, 2, 8, 11, 0.4, 1024, 66, 809, 11, 8.9, 1.1, 3.42, 9, 100, 444, 78] #your code goes here n=data.remove(max,min)
7th Apr 2021, 11:34 AM
Simisola Osinowo
Simisola Osinowo - avatar
- 2
Vadivelan can you write how the code will look like
7th Apr 2021, 11:57 AM
Simisola Osinowo
Simisola Osinowo - avatar