As a newbie programmer
As a newbie programmer

As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets


The Floating circle @ Dcoder

27 May 2023 1 minute read 0 comments Lochard

Title: The Floating circle Problem: Cody is a student in Trumph Academy, He is preparing for SSC, while he was solving some problems, he found an easy problem of Circles. The problem is You have to calculate the area of a Circle, radius of the circle...

Reverse The Linked list @ Dcoder

26 May 2023 1 minute read 0 comments Lochard

Problem: You are given a linked list, you just need to reverse its order without changing any pointer, ie print the tail first and head last. Input: Input contains elements of linked list separated by space and terminated by -1 Output: Print reversed...

Find the eldest brother! @ Dcoder

25 May 2023 1 minute read 0 comments Lochard

Problem: There are 5 brothers in a family, you need to tell eldest brother's age. You are given age of all the brothers. Input: Input contains 5 numbers separated by space indicating the ages of 5 brothers. Output: Print the age of eldest brother. Co...

Tracy's love. @ Dcoder

24 May 2023 1 minute read 0 comments Lochard

Problem: Hey, my name is Tracy.I am 4 year old and love the number 6.I want to play a number game with you, I'll give you two numbers and you just need to tell whether their sum or difference can be the number I love,6. Input: Input contains 2 intege...

Equable Triangles @ Dcoder

23 May 2023 1 minute read 0 comments Lochard

Title: Equable Triangles Problem: An Equable Triangle is a triangle which has its area equals to the sum of its sides.  You are given with the sides of a triangle, your task is to write a code which will return 'True'. if the triangle is equable, oth...

Tables @ Dcoder

22 May 2023 1 minute read 0 comments Lochard

Problem: Cody is now in 1st standard, he is learning tables. Help him printing table of n.  Input: Input containts n, an integer. Output: Print Table of n. Constraints: 1≤n≤10000 Sample Input: 2 Sample Output:  2 4 6 8 10 12 14 16 18 20 n = int(input...

Help Cody @ Dcoder

20 May 2023 1 minute read 0 comments Lochard

Title: Help Cody Problem: Cody is stuck in a problem and needs your help to get out of trouble. He was given a sorted array by his teacher. After his teacher left, he mistakenly rearranged some elements of the array. Help Cody sort the array before h...

The Armstrong Number @ Dcoder

18 May 2023 1 minute read 0 comments Lochard

Problem: An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, consider the number 371. The sum of the cube of its digits is 3^3 + 7^3 + 1^3 = 27 + 343 + 1 = 371. Th...

Total Expenses @ Dcoder

17 May 2023 1 minute read 0 comments Lochard

Problem: Joey went for shopping. The shopkeeper gives a discount of 10% if the total expense exceeds 1000 . Given total expense as input, write a program to calculate the total money Joey has to give to the shopkeeper after the discount, if discount...

Buy The Bundle @ Dcoder

16 May 2023 1 minute read 0 comments Lochard

Problem: Jimmy wants to buy books for N students. He went to the bookshop to buy a bundle of books, each bundle has a different number of books. He wants to buy such a bundle that contains the number of books, which can be distributed equally amongst...