Python入门简单操作

# -*- coding: utf-8 -*-
"""
Created on Fri Oct 12 15:40:37 2018

@author: Administrator
"""

#%%
import tensorflow as tf
import numpy as np
a = np.array([1,2,3,4,5,6,7,8,9],dtype='float32');
a = a.reshape(3,3);
c = a + [22,33,44];#c.dtype='float64'
c = c.astype(np.float32)
#c.dtype = 'float32'
print('c=',c);
condition = 1
while (condition < 10):
    print(condition)
    condition = condition + 1
example_list = [1,2,3,4,5,6,7,88,99]
for i in example_list:
    print(i)
for i in range(len(example_list)):
    print(i)
    print(example_list[i])
for i in range(2,10):
    print(i)
x = 1
y = 0
z = 3
if(x>y):
    print('x>y')
elif(x==y):
    print('x=y')
else:
    print('x

 

你可能感兴趣的:(Python入门简单操作)