Recent Updates Page 3 Toggle Comment Threads | Keyboard Shortcuts
-
Pleosin
-
Pleosin
How To Install Django on Windows 10 | Use Django with ATOM
This tutorial will not only help you answer the how to install Django on Windows 10 question but also help you install Django if you have Windows 7, Windows 8 or Windows 8.1.
You can follow the same steps for all the windows versions mentioned above. (More …)
Pleosin
Debugging Python Applications with pdb

Debugging isn’t a new trick – most developers actively use it in their work. Of course, everyone has their own approach to debugging, but I’ve seen too many specialists try to spot bugs using basic things like print instead of actual debugging tools. Or even if they did use a debugging tool, they only used a small set of features and didn’t dig deeper into the wide range of opportunities good debuggers offer. And which could have saved those specialists a lot of time. (More …)
Pleosin
Basic data types and structures practice in python
###############
## Problem 1 ##
###############
## Given the string:
s = ‘django’
(More …)
Pleosin
Simple Connect Four Game Code
For this simple game. You have to create an HTML file, a CSS file, and a JAVASCRIPT file. Follow the below line for full code. (More …)
Pleosin
Build a school timetable with python
Today, we’ll learn how with a simple script, we can create a program which helps us to build a school timetable.
We suppose that as a school manager, we want to make easy the way to establish a school timetable for each class. (More …)
Pleosin
Simple Tic, Tac, Toe game code
For this simple game. You have to create an HTML file, a CSS file, and a JAVASCRIPT file. Follow the below line for full code. (More …)
Pleosin
Previous exercises, we created this function:
>>> def string_length(mystring): ... return len(mystring)
Calling the function with a string as the value for the argument mystring will return the length of that string.
If an integer is passed as an argument value:
string_length(10)
that would generate an error since the len() function doesn’t work for integers.
We have to modify the function so that when an integer is passed as input, the function should output a message like “Sorry integers don’t have length.”
So, How we do it?
>>> def string_length(mystring): ... if type(mystring) == int: ... return "Sorry, integers don't have length" ... else: ... return len(mystring) ... >>> string_length(10) "Sorry integers don't have length."
That’s it!
Pleosin
Create a function that takes any string as an argument and returns the length of that string.
So, the code is:
>>> def string_length(mystring):
... return len(mystring)
...
>>> print(string_length("Hello"))
5
Pleosin
Create a function that converts Celsius degrees to Fahrenheit. The formula to convert Celsius to Fahrenheit is F = C × 9/5 + 32.
Here goes the code:
>>> def cel_to_far(celsius): ... fahrenheit = celsius *9/5+32 ... return fahrenheit ... >>> print(cel_to_far(10)) 50.0
That’s it. here you go!
-
TRBS083 www.mail1.ru
TRBS083 http://www.mail1.ru
LikeLike
Reply