forked from GEJ1/python101-2017-1c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (41 loc) · 1.49 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python3.5
# -*- coding: utf-8 -*-
'''
Created on 9 jul. 2016
@author: Lucas
'''
if __name__ == '__main__':
name = str(input("ingrese su nombre:\n"))
print(name)
#name = str(raw_input("What is your name: "))
#age = int(raw_input("How old are you: "))
#year = str((2014 - age)+100)
#print(name + " will be 100 years old in the year " + year)
#On Python 2.x you need to be using raw_input() rather than input(). On the older version of Python, input() actually evaluates what you type as a Python expression, which is why you need the quotes (as you would if you were writing the string in a Python program).
#There are many differences between Python 3.x and Python 2.x; this is just one of them. However, you could work around this specific difference with code like this:
#try:
# input = raw_input
#except NameError:
# pass
# now input() does the job on either 2.x or 3.
value = input("ingrese valor\n")
print(value)
# Ejercicio enteros
print("Suma 3 + 2")
suma = 3+2
resta = suma - suma
division = resta / suma
print(division)
division = suma / (suma - 1)
print(division)
division = float(suma) / (suma - 1)
print(division)
multilinea = """este es un ejemplo
con multiples lines
lo pueden ver"""
print(multilinea)
value = 65
multilinea = """este es otro ejemplo
de multilinea con una variable """+str(value)+""" y puedo
seguir escribiendo!"""
print(multilinea)