New to Python


#1

Hello All, My name is Manish and i have joined this community to learn Python.

I started my session with Code academy and i am stuck with the session Bringing it all together.

Let's put our knowledge to work.

Write a single-line comment on line 1. It can be anything! (Make sure it starts with #)
Set the variable monty equal to True.
Set another variable python equal to 1.234.
Set a third variable monty_python equal to python squared.

and my answer is

my first python scripting

monty= True
python= 1.234
monty_python= python squared

print monty

Kindly help me to find the mistake in this code.


#2

So unlike when you declare a variable such as monty_python, when it says python squared rather than writing out python squared it actually means to square python by using the square (aka ** 2) so your monty_python should look something like this:

monty_python = python ** 2

P.S. Thank you for such great organization in your first posts! Glad to see some new comers to the site actually read the guidelines :smiley:


#3

I am currently stuck at boolean pretty much the second task in python Set the following variables to the corresponding values: my_int to the value 7 my_float to the value.

this is what I have coded so far: my_int=7
my_float=False
my_bool=True but I still get an error message. Please help.


#4

Ok so here is your problem if you haven't already figured it out. In the instructions it asks you to set my_float to 1.23 not false.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.