Skip to main content

Posts

Web programming part 2

Hello guys, I am back with another post on web programming. In the last post you guys had learnt how to create a simple HTML document. As i told you there are many tags that you might have to remember. In this Post i will be creating a small Login form using only HTML. By using only HTML i mean No styling will be given to the document. The purpose of this code is to demonstrate you tags like <form> and <label> you will also learn how to make a button in HTML. The code goes like this: < form  action ="/action_page.php" >      < label > < b > Username < /b > < /label >      < input  type ="text"  placeholder ="Enter Username" >      < label > < b > Password < /b > < /label >      < input  type ="password"  placeholder ="Enter Password" >      < button  type ="submit" ...

A simple Calculator Using Python

Hello viewers, Today I am gonna show you a simple code to help you make a calculator using Python programming language. There are a number of ways of doing this.The man idea behind this code is to teach you how to write functions in Python. The syntax goes like this Syntax def functionname ( parameters ): "function_docstring" function_suite return [ expression ] By default, parameters have a positional behavior and you need to inform them in the same order that they were defined. Example The following function takes a string as input parameter and prints it on standard screen. def printme ( str ): "This prints a passed string into this function" print str return The calculator code here: ''' Program make a simple calculator that can add, subtract, multiply and divide using functions ''' # define functions def add ( x , y ): """This function adds two numbers""...

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*/ ...