About 11,500,000 results
Open links in new tab
  1. Converting height in python: commas for feet and inches giving …

    Feb 11, 2016 · To do the conversion, you want to calculate total inches and then convert to metric. So following from the snippet above: As for input vs raw_input, it would help to know which version of Python you're using, as raw_input is a 2.X feature (not usable in 3.X).

  2. Python Program to Convert Centimeters to Feet and Inches

    1. Take the height in centimeters and store it in a variable. 2. Convert the height in centimeters into inches and feet. 3. Print the length in inches and feet. 4. Exit.

  3. Python Tutorial - W3Schools

    With our "Try it Yourself" editor, you can edit Python code and view the result. print("Hello, World!") Click on the "Try it Yourself" button to see how it works. In our File Handling section you will learn how to open, read, write, and delete files. Python File Handling.

  4. Python: Convert feet and inches to centimeters - w3resource

    Apr 16, 2025 · Write a Python program to convert height (in feet and inches) to centimeters. Sample Solution: # Prompt the user to input their height. print("Input your height: ") # Read the feet part of the height and convert it to an integer. h_ft = int(input("Feet: ")) # Read the inches part of the height and convert it to an integer.

  5. 5 Best Ways to Convert Height from Centimeters to Feet and Inches in Python

    Mar 6, 2024 · In this snippet, we convert height in centimeters to inches and then use the divmod() function to obtain both feet and inches in a single step. This code is concise and avoids the need for explicitly using floor division and the modulo operation.

  6. Convert Height from Centimeters to Feet and Inches in Python

    Apr 16, 2021 · Learn how to convert height from centimeters to feet and inches using a simple Python program.

  7. How do I make a height converter in python? : r/learnpython - Reddit

    Jun 2, 2021 · How do I make a height converter in python? Silly question, I’m in a beginners Computer Science class and we’ve been tasked to make a height converter (user inputs their height in feet, and the program converts it to inches).

  8. How to set a variable to = width or height in Python Processing?

    Normally, if you want to define a variable with the height, width or width/2 of the window in Jave Processing, you can declare it as follows: However, trying this in Python will throw an error: Here is my code using Python: x = width/2. y = height/2. def draw(self): ellipse(self.x, self.y, 20, 20) Thanks in advance :)

  9. python - Setting the Height of Matplotlib Histogram - Stack Overflow

    Nov 28, 2018 · You can modify the height of these objects: # Create your histogram: n, bins, rects = plt.hist(x, num_bins, ec='k') # iterate through rectangles, change the height of each for r in rects: r.set_height(r.get_height()/r.get_width()) # set the y limit plt.ylim(0,1) plt.show()

  10. Height of a Binary Tree in Python (with or without Recursion)

    May 6, 2023 · Find out how to find the height of a binary tree in Python with code. We will do it using BFS and DFS approaches with or without recursion.

  11. Some results have been removed
Refresh