Skip to main content

Posts

Showing posts with the label commnets in python

Strings in Python - TipsForCse

STRINGS & CONSOLE OUTPUT Strings Another useful data type is the  string . A  string  can contain letters, numbers, and symbols. name =  "Ryan" age =  "19" food =  "cheese" In the above example, we create a variable  name  and set it to the string value  "Ryan" . We also set  age  to  "19"  and  food  to  "cheese" . Strings need to be within quotes.

Best Python Projects For Final Year Computer Science

Python Final Year Projects :   1. Hangman Project in Python   Python Project Idea – The objective of this project is to implement the hangman game using Python. This project doesn’t require any external modules rather just needs random and time modules of Python. Python functions and loops are enough to develop a hangman game                                                                                                                    2. Rock Paper Scissors Python Game   Python Project Idea – The rock paper scissors is a game played between two players that have few sets of rules. We can define the rules and conditions ...

Comments And Receiving Input in Python - tips4cse

Comments And Receiving Input in Python :  Comments : We use comments to add notes to our code. Good comments explain the hows and whys, not what the code does. That should be reflected in the code itself. Use comments to add reminders to yourself or other developers, or also explain your assumptions and the reasons you’ve written code in a certain way. # This is a comment and it won’t get executed. # Our comments can be multiple lines. Taking User Input: Receiving Input : We can receive input from the user by calling the input() function. birth_year = int ( input ( ‘Birth year: ‘ )) The input() function always returns data as a string. So, we’re converting the result into an integer by calling the built-in int() function.