Jump to content

Drfeelbad

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Drfeelbad's Achievements

Newbie

Newbie (1/14)

10

Reputation

  1. Multumesc! Programul merge cum trebuie folosind if distype[0].lower() == "m" sau "k"
  2. Multumusc, dar am dat de alta problema Rezultatul e gresit, si nu imi dau seama de ce Insert distance: 10 Insert the distance type: km Insert the number of minutes: 60 Insert the number of seconds: 0 16.1 kilometers per hour 10.0 miles per hour
  3. Drfeelbad

    Problema

    Buna! Acesta este primul meu thread de pe rstcenter. Vreau sa creez un program in Python 3.2 care sa calculeze viteza in mile pe ora si kilometri dar functia print imi da batai de cap. Cum pot sa printez o variabila integer si un text in acelasi print? Am incercat sa fac si o variabila string dar nu a mers. def mph(): dis=int(input("Insert distance: ")) distype=input("Miles or Kilometers?") minutes=int(input("Insert the number of minutes: ")) secs=int(input("Insert the number of seconds")) time = (minutes + (secs/60))/60 if distype == "miles" or "Miles" or "Mil" or "mil": speedinkm = (dis * 1.61)/time speedinmiles = dis / time if distype == "Kilometer" or "Kilometers" or "kilometer" or "Kilometer" or "km" or "Km": speedinmil = (dis / 1.61)/time speedinkm = dis / time kmh=" kilometers per hour" mph=" miles per hour" print (speedinkm + kmh) print (speedinmil + mph) mph()
  4. Drfeelbad

    Salut

    Ma numesc Vlad si vreau sa invat programare. Momentan stiu ceva html si python
×
×
  • Create New...