Skip to main content

Posts

An Alcoholic Python Program! My friends' first step in Python programming XD

Hi folks,              Today my dear friends Akshay and Chetan have taken their first step towards learning the Python programming language. This is the program they have written after learning the language for the whole day.              Let us appreciate their interest towards learning Python.                           They sure have a fun way of learning things. I hope you like the program! Thank you!         :) #Basic input operation day = raw_input ( "What is the day today?? \n " ) #list declarations weekday = [ 'monday' , 'tuesday' , 'wednesday' , 'thursday' , 'friday' ] weekend = [ 'saturday' , 'sunday' ] #Implementation of if statements if day in weekday:     ...

Detailed explanation of Tuple data structure in the Python Programming language

Hi guys,           I am posting a detailed explanation of Tuple data structure in the Python Programming language.           I have explained the code with detailed comments. I hope the explanation is sufficient. Please comment or contact us in case of any inconsistencies. Hope you like it. Thank you very much.       :) #CODE BEGINS #tuples tup1 = ( 'Hi' , 3.1416 , 125 ,[ 1 , 2 , 3 ]) tup2 = ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) tup3 = ( 'a' , 'b' , 'c' , 'd' , 'f' ) tup4 = ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) mini = ( 'i' ) l = [ 'l' , 'm' , 'n' ] #Displays the entire tuple print tup2, " \n " #display selected elements print "tup2[3] = " ,tup2[ 3 ], " \n " #Slicing print "tup2[2:] = " ,tup2[ 2 :], " \n " #Reversing a tuple print tup3[::- 1 ] print "#########################################################...

A C program for electronic voting machine!

Hello guys,           Today I would like to share with all of you, my first mini project which I had done a few years ago when I was a beginner to the Programming world.           This is a simple C program which mainly illustrates the file handling operations in C. I have explained the code with the comments.           I hope you like it. :) //        CODE         BEGINS /*C program for smart voter*/ #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> #define VTR_MAX_CNT 5 /*      Maximum number of votes to be casted Depends on the User           */ void cast_vote();     /*Declaring function to cast vote*/ ...

Printing the text horizontally in Python Programming language

Hi guys,         We know that the "print" function is used to print the data to the standard output device in Python Programming language. But, the print function automatically adds a newline character every time we cal it.        For example, consider a program segment to display numbers from 1 to 5:                                                                            for n in range ( 1 , 6 ):                                     print n           The outpu...