January 2019
Beginner to intermediate
776 pages
19h 58m
English
This example summarizes the best practices using all the elements that we have learned so far, by creating a basic program.
Problem statement: Parse all the countries declared in an array and only print the names of those countries that contain the letter I or letter U in their names:
Program begin:Comment: This is a sample program to explain best practiceComment: Author name: ProgrammerComment: Email: Programmer@programming.comVersion: 1.0Comment: The following section declares the list of countries in array countrylistcountrylist=['India','US','UK','France','China','Japan']function validatecountryname(countryname) Comment: This function takes the input of countryname, checks if it contains I or U and returns ...
Read now
Unlock full access