为什么在python shell中运行以下代码片段时会打印20
?
print 0xA + 0xa
答案 0 :(得分:2)
0x前缀用于表示十六进制数。 0xA + 0xA等于0x14。打印会将其转换为十进制数字,标记为20。
答案 1 :(得分:1)
0xA
和0xa
是10
代表<Window x:Class="CharunOptics.Search"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Charun Optics" Height="800px" Width="1600px" WindowStartupLocation="CenterScreen" WindowState="Maximized" Loaded="Window_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="7*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
<ColumnDefinition Width="1*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Content="Search: (Name or Contact)" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,25,0" VerticalAlignment="Center" FontSize="20"/>
<TextBox Grid.Column="1" HorizontalAlignment="Stretch" Height="auto" Margin="25,0,25,0" TextWrapping="Wrap" Text="" VerticalAlignment="Center" FontSize="20" Grid.Row="0" Name="TxtName"/>
<Button x:Name="BtnSearch" Grid.Column="2" Grid.Row="0" Content="Search" FontSize="20" Click="BtnSearch_Click" Margin="32"/>
</Grid>
</Grid>
<DataGrid Grid.Row="1" Grid.Column="0" Name="DtGrid" ColumnWidth="*" CanUserAddRows="False">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="{StaticResource PrimaryBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PrimaryFont}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
</Grid>
。