[Solved] Complete Details HackerRank Problem

A student wants to display his/ her name along with mobile number. Your task is to make a program that read the first name and mobile numbers of the student and prints the complete details.

Hello, First Name Mobile Number! You are a good student.

Input Format

The first line contains the first name, and the second line contains the mobile numbers.

Sample Input:

Virat

9988776655

Constraints

The length of the first name ≤ 15 and mobile number=10.

Output Format

Complete details should be printed as:

Hello, First Name! You are a good student.

Sample Output:

Hello, Virat 998877655! You are a good student.

Sample Input 0

Virat
9988776655

Sample Output 0

Hello, Virat 998877655! You are a good student.

Solution


name = input()
mobile = int(input())
n = len(name)
m = len(str(mobile))
if n <= 15 and m == 10:
    print(str("Hello, " + name + " " + str(mobile)[0:7]+str(mobile)[8:10]+ "! You are a good student."))
[Solved] Complete Details HackerRank Problem

Happy Learning – If you require any further information, feel free to contact me.

Share your love
Saurav Hathi

Saurav Hathi

I'm currently studying Bachelor of Computer Science at Lovely Professional University in Punjab.

📌 Nodejs and Android 😎
📌 Java

Articles: 444

Leave a Reply

Your email address will not be published. Required fields are marked *