Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Python tutorial for beginners

Loading...

Sign in or sign up now!
194,382
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 31, 2007

Thank you
Below is the C2F conversion calculator, keep in mind it is only 4 lines long.

def C2F():
Celsius = input('Enter degrees in Celsius: ');
Fahrenheit = (9.0 / 5.0) * Celsius +32;
print Celsius, 'Celsius =', Fahrenheit, 'Fahrenheit';

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 33 dislikes

Link to this comment:

Share to:

Top Comments

  • On the 'print Celsius' line, the 'print' turned purple, and when I tried to run it, it said Syntax Error, and highlighted the Celsius part of the text. I'm using version 3.2.2

  • @TheBrokenVampire2 Python 3.x handles print statements differently. You need to put everything you want to print in parentheses. So it would be:

    Print (Celsius, 'Celsius =', Fahrenheit, 'Fahrenheit');

see all

All Comments (561)

Sign In or Sign Up now to post a comment!
  • @Stormrage32 Figured it out! indenting is very important!

  • @TheBrokenVampire2 Is it UNIX (Linux or Ubuntu) based? If so then the console commands will be the same. So if you figure it out, please tell me!

    Thanks!

  • @TheBrokenVampire2

    in version 3.2.2, they want you to place the variable in brackets. Therefore, you'd type

    print(Celcius) instead of just print Celsius. One of the small changes of 3.2.2 :D

  • @pos6666666 I fixed it by typing in "Celsius. print" without the quotation marks, though when I open up the shell it doesn't do anything.

  • @Stormrage32 No, I'm not on a Mac. Just a normal laptop.

  • @TheBrokenVampire2 I get the same thing on 2.7.2 version as well. I typed it all out and tried to copy and paste, still got the same thing. Wonder what is wrong?

  • @TheBrokenVampire2 Same Here! Are you on a mac?

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more