+ 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].)
10 Réponses
+ 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
+ 2
print(fname[0] + "." + lname[0]+".")
You are try get 2nd letter.
Remember Index starts with 0.
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.
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
0
Thanks
0
It is the best way to this:
fname = input()
lname = input()
print(fname[0]+"." +lname[0]+".")
it is correct.
0
fname = input()
lname = input()
print(fname[0] + "." + lname[0] + ".")
- 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.
- 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)
- 2
Vadivelan can you write how the code will look like